Overview
| Comment: | Use a regular int for the tagged pointer class ID |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | tagged-pointers |
| Files: | files | file ages | folders |
| SHA3-256: |
a8d453813ca8007658d52532885acd9c |
| User & Date: | js on 2020-07-04 00:40:47 |
| Other Links: | branch diff | manifest | tags |
Context
|
2020-07-04
| ||
| 11:51 | lookup-asm-sparc64-elf.S: Support tagged pointers (check-in: 09e046628e user: js tags: tagged-pointers) | |
| 00:40 | Use a regular int for the tagged pointer class ID (check-in: a8d453813c user: js tags: tagged-pointers) | |
| 00:24 | Only use 4 bits to classify tagged pointers (check-in: 943cf97843 user: js tags: tagged-pointers) | |
Changes
Modified src/runtime/ObjFWRT.h from [419dceb932] to [852e5138d0].
| ︙ | ︙ | |||
240 241 242 243 244 245 246 |
objc_enumeration_mutation_handler_t _Nullable handler);
extern id _Nullable objc_constructInstance(Class _Nullable class_,
void *_Nullable bytes);
extern void *_Nullable objc_destructInstance(id _Nullable object);
extern void *_Null_unspecified objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void *_Null_unspecified pool);
extern id _Nullable _objc_rootAutorelease(id _Nullable object);
| | | < | 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 |
objc_enumeration_mutation_handler_t _Nullable handler);
extern id _Nullable objc_constructInstance(Class _Nullable class_,
void *_Nullable bytes);
extern void *_Nullable objc_destructInstance(id _Nullable object);
extern void *_Null_unspecified objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void *_Null_unspecified pool);
extern id _Nullable _objc_rootAutorelease(id _Nullable object);
extern int objc_registerTaggedPointerClass(Class _Nonnull class);
extern Class _Nullable object_getTaggedPointerClass(id _Nonnull object);
extern uintptr_t object_getTaggedPointerValue(id _Nonnull object);
extern id _Nullable objc_createTaggedPointer(int class, uintptr_t value);
/*
* Used by the compiler, but can also be called manually.
*
* These declarations are also required to prevent Clang's implicit
* declarations which include __declspec(dllimport) on Windows.
*/
|
| ︙ | ︙ |
Modified src/runtime/amiga-glue.m from [bd99617da7] to [3dbec0ba16].
| ︙ | ︙ | |||
796 797 798 799 800 801 802 |
glue_objc_hashtable_free PPC_PARAMS(struct objc_hashtable *table)
{
M68K_ARG(struct objc_hashtable *, table, a0)
objc_hashtable_free(table);
}
| | | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 |
glue_objc_hashtable_free PPC_PARAMS(struct objc_hashtable *table)
{
M68K_ARG(struct objc_hashtable *, table, a0)
objc_hashtable_free(table);
}
int
glue_objc_registerTaggedPointerClass PPC_PARAMS(Class class)
{
M68K_ARG(Class, class, a0)
return objc_registerTaggedPointerClass(class);
}
|
| ︙ | ︙ | |||
821 822 823 824 825 826 827 |
{
M68K_ARG(id, object, a0)
return object_getTaggedPointerValue(object);
}
id
| | | | 821 822 823 824 825 826 827 828 829 830 831 832 833 834 |
{
M68K_ARG(id, object, a0)
return object_getTaggedPointerValue(object);
}
id
glue_objc_createTaggedPointer PPC_PARAMS(int class, uintptr_t value)
{
M68K_ARG(int, class, d0)
M68K_ARG(uintptr_t, value, d1)
return objc_createTaggedPointer(class, value);
}
|
Modified src/runtime/amiga-library.m from [ee22f330db] to [7a20b4c30e].
| ︙ | ︙ | |||
143 144 145 146 147 148 149 | extern void glue_objc_autoreleasePoolPop(void); extern id glue__objc_rootAutorelease(void); extern struct objc_hashtable *glue_objc_hashtable_new(void); extern void glue_objc_hashtable_set(void); extern void *glue_objc_hashtable_get(void); extern void glue_objc_hashtable_delete(void); extern void glue_objc_hashtable_free(void); | | | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 | extern void glue_objc_autoreleasePoolPop(void); extern id glue__objc_rootAutorelease(void); extern struct objc_hashtable *glue_objc_hashtable_new(void); extern void glue_objc_hashtable_set(void); extern void *glue_objc_hashtable_get(void); extern void glue_objc_hashtable_delete(void); extern void glue_objc_hashtable_free(void); extern int glue_objc_registerTaggedPointerClass(void); extern Class _Nullable glue_object_getTaggedPointerClass(void); extern uintptr_t glue_object_getTaggedPointerValue(void); extern id _Nullable glue_objc_createTaggedPointer(void); #ifdef OF_MORPHOS const ULONG __abox__ = 1; #endif |
| ︙ | ︙ |
Modified src/runtime/amigaos3.sfd from [bce272de78] to [a0d1b4c012].
| ︙ | ︙ | |||
86 87 88 89 90 91 92 | * The following functions are private! Don't use! struct objc_hashtable *_Nonnull glue_objc_hashtable_new(objc_hashtable_hash_func hash, objc_hashtable_equal_func equal, uint32_t size)(a0,a1,d0) void glue_objc_hashtable_set(struct objc_hashtable *_Nonnull table, const void *_Nonnull key, const void *_Nonnull object)(a0,a1,a2) void *_Nullable glue_objc_hashtable_get(struct objc_hashtable *_Nonnull table, const void *_Nonnull key)(a0,a1) void glue_objc_hashtable_delete(struct objc_hashtable *_Nonnull table, const void *_Nonnull key)(a0,a1) void glue_objc_hashtable_free(struct objc_hashtable *_Nonnull table)(a0) * Public functions again | | | | 86 87 88 89 90 91 92 93 94 95 96 97 | * The following functions are private! Don't use! struct objc_hashtable *_Nonnull glue_objc_hashtable_new(objc_hashtable_hash_func hash, objc_hashtable_equal_func equal, uint32_t size)(a0,a1,d0) void glue_objc_hashtable_set(struct objc_hashtable *_Nonnull table, const void *_Nonnull key, const void *_Nonnull object)(a0,a1,a2) void *_Nullable glue_objc_hashtable_get(struct objc_hashtable *_Nonnull table, const void *_Nonnull key)(a0,a1) void glue_objc_hashtable_delete(struct objc_hashtable *_Nonnull table, const void *_Nonnull key)(a0,a1) void glue_objc_hashtable_free(struct objc_hashtable *_Nonnull table)(a0) * Public functions again int glue_objc_registerTaggedPointerClass(Class _Nonnull class_)(a0) Class _Nullable glue_object_getTaggedPointerClass(id _Nonnull object)(a0) uintptr_t glue_object_getTaggedPointerValue(id _Nonnull object)(a0) id _Nullable glue_objc_createTaggedPointer(int class_, uintptr_t value)(d0,d1) ==end |
Modified src/runtime/linklib/linklib.m from [8bd799cb5a] to [b0ccaf3f6e].
| ︙ | ︙ | |||
704 705 706 707 708 709 710 |
void
objc_hashtable_free(struct objc_hashtable *table)
{
glue_objc_hashtable_free(table);
}
| > | > > > > > | > | > | | > > > > > > > > > > | 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 |
void
objc_hashtable_free(struct objc_hashtable *table)
{
glue_objc_hashtable_free(table);
}
int
objc_registerTaggedPointerClass(Class class)
{
return glue_objc_registerTaggedPointerClass(class);
}
Class
object_getTaggedPointerClass(id object)
{
return glue_object_getTaggedPointerClass(object);
}
uintptr_t
object_getTaggedPointerValue(id object)
{
return glue_object_getTaggedPointerValue(object);
}
id
objc_createTaggedPointer(int class, uintptr_t value)
{
return objc_createTaggedPointer(class, value);
}
|
Modified src/runtime/morphos-clib.h from [5d4187d2f7] to [003198598f].
| ︙ | ︙ | |||
81 82 83 84 85 86 87 | /* The following functions are private! Don't use! */ struct objc_hashtable *glue_objc_hashtable_new(objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t); void glue_objc_hashtable_set(struct objc_hashtable *, const void *, const void *); void *glue_objc_hashtable_get(struct objc_hashtable *, const void *); void glue_objc_hashtable_delete(struct objc_hashtable *, const void *); void glue_objc_hashtable_free(struct objc_hashtable *); /* Public functions again */ | | | | 81 82 83 84 85 86 87 88 89 90 91 | /* The following functions are private! Don't use! */ struct objc_hashtable *glue_objc_hashtable_new(objc_hashtable_hash_func, objc_hashtable_equal_func, uint32_t); void glue_objc_hashtable_set(struct objc_hashtable *, const void *, const void *); void *glue_objc_hashtable_get(struct objc_hashtable *, const void *); void glue_objc_hashtable_delete(struct objc_hashtable *, const void *); void glue_objc_hashtable_free(struct objc_hashtable *); /* Public functions again */ int glue_objc_registerTaggedPointerClass(Class); Class _Nullable glue_object_getTaggedPointerClass(id); uintptr_t glue_object_getTaggedPointerValue(id); id glue_objc_createTaggedPointer(int, uintptr_t); |
Modified src/runtime/tagged-pointer.m from [1f64e311ce] to [eeba4c306c].
| ︙ | ︙ | |||
19 20 21 22 23 24 25 | #import "private.h" #define TAGGED_POINTER_BITS 4 #define NUM_TAGGED_POINTER_CLASSES (1 << (TAGGED_POINTER_BITS - 1)) Class objc_tagged_pointer_classes[NUM_TAGGED_POINTER_CLASSES]; | | | | | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
#import "private.h"
#define TAGGED_POINTER_BITS 4
#define NUM_TAGGED_POINTER_CLASSES (1 << (TAGGED_POINTER_BITS - 1))
Class objc_tagged_pointer_classes[NUM_TAGGED_POINTER_CLASSES];
static int taggedPointerClassesCount;
int
objc_registerTaggedPointerClass(Class class)
{
int i;
objc_global_mutex_lock();
if (taggedPointerClassesCount == NUM_TAGGED_POINTER_CLASSES) {
objc_global_mutex_unlock();
return -1;
}
|
| ︙ | ︙ | |||
66 67 68 69 70 71 72 | pointer >>= TAGGED_POINTER_BITS; return pointer; } id | | | | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
pointer >>= TAGGED_POINTER_BITS;
return pointer;
}
id
objc_createTaggedPointer(int class, uintptr_t value)
{
uintptr_t pointer;
if (class < 0 || class >= NUM_TAGGED_POINTER_CLASSES)
return nil;
if (value > (UINTPTR_MAX >> TAGGED_POINTER_BITS))
return nil;
pointer = (class << 1) | 1;
pointer |= (value << TAGGED_POINTER_BITS);
return (id)pointer;
}
|