Overview
| Comment: | Add support for tagged pointers in object_getClass
This already makes tagged pointers work in the non-assembly lookup. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | tagged-pointers |
| Files: | files | file ages | folders |
| SHA3-256: |
8707dd73c44f01774016800bd5216007 |
| User & Date: | js on 2020-06-29 20:30:49 |
| Other Links: | branch diff | manifest | tags |
Context
|
2020-06-29
| ||
| 23:17 | Merge trunk into branch "tagged-pointers" (check-in: f5be211a1b user: js tags: tagged-pointers) | |
| 20:30 | Add support for tagged pointers in object_getClass (check-in: 8707dd73c4 user: js tags: tagged-pointers) | |
| 19:42 | runtime: Add helper functions for tagged pointers (check-in: a964d3dcb4 user: js tags: tagged-pointers) | |
Changes
Modified src/runtime/class.m from [959b2ef399] to [02bad041ab].
| ︙ | |||
842 843 844 845 846 847 848 849 850 851 852 853 854 855 | 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 | + + + |
object_getClass(id object_)
{
struct objc_object *object;
if (object_ == nil)
return Nil;
if (object_isTaggedPointer(object_))
return object_getTaggedPointerClass(object_);
object = (struct objc_object *)object_;
return object->isa;
}
Class
object_setClass(id object_, Class class)
|
| ︙ |
Modified src/runtime/private.h from [82de8c2339] to [e3fff27493].
| ︙ | |||
331 332 333 334 335 336 337 338 339 340 341 342 343 344 | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | + + + + + + + + |
#else
uint8_t i = idx >> 8;
uint8_t j = idx;
return dtable->buckets[i]->buckets[j];
#endif
}
static inline bool
object_isTaggedPointer(id _Nullable object)
{
uintptr_t pointer = (uintptr_t)object;
return pointer & 1;
}
#if defined(OF_ELF)
# if defined(OF_X86_64) || defined(OF_X86) || defined(OF_POWERPC) || \
defined(OF_ARM64) || defined(OF_ARM) || \
defined(OF_MIPS64_N64) || defined(OF_MIPS) || \
defined(OF_SPARC64) || defined(OF_SPARC)
# define OF_ASM_LOOKUP
|
| ︙ |