Differences From Artifact [fa7e7433b3]:
- File src/runtime/runtime-private.h — part of check-in [8b9ea05af4] at 2014-05-02 22:49:03 on branch trunk — Only use SPARC assembly if __arch64__ is undefined (user: js, size: 5770) [annotate] [blame] [check-ins using]
To Artifact [bdd53fa1db]:
- File
src/runtime/runtime-private.h
— part of check-in
[1ebb9eb7b3]
at
2014-05-15 15:32:35
on branch trunk
— Multiple dtable / sparse array improvements
* dtable.m is now the old sparse array, using IMP as type for values and
thus not violating the C standard anymore (functions may not be stored
in void*)
* New sparsearray.m which can work with any size, based on the sparse
array from the fast path of class.m
* Fast path of class.m now uses the new sparsearray.m (user: js, size: 5963) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
99 100 101 102 103 104 105 | uint32_t (*hash)(const void *key); bool (*equal)(const void *key1, const void *key2); uint32_t count, size; struct objc_hashtable_bucket **data; }; struct objc_sparsearray { | | > > > > > | | < < < | < < > > | < | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | uint32_t (*hash)(const void *key); bool (*equal)(const void *key1, const void *key2); uint32_t count, size; struct objc_hashtable_bucket **data; }; struct objc_sparsearray { struct objc_sparsearray_data { void *next[256]; } *data; uint_fast8_t index_size; }; struct objc_dtable { struct objc_dtable_level2 { #ifdef OF_SELUID24 struct objc_dtable_level3 { IMP buckets[256]; } *buckets[256]; #else IMP buckets[256]; #endif } *buckets[256]; }; extern void objc_register_all_categories(struct objc_abi_symtab*); extern struct objc_category** objc_categories_for_class(Class); extern void objc_unregister_all_categories(void); extern void objc_initialize_class(Class); extern void objc_update_dtable(Class); extern void objc_register_all_classes(struct objc_abi_symtab*); |
︙ | ︙ | |||
138 139 140 141 142 143 144 | const void*); extern void* objc_hashtable_get(struct objc_hashtable*, const void*); extern void objc_hashtable_delete(struct objc_hashtable*, const void*); extern void objc_hashtable_free(struct objc_hashtable *h); extern void objc_register_selector(struct objc_abi_selector*); extern void objc_register_all_selectors(struct objc_abi_symtab*); extern void objc_unregister_all_selectors(void); | | < | | < > > > > | | | | | | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | const void*); extern void* objc_hashtable_get(struct objc_hashtable*, const void*); extern void objc_hashtable_delete(struct objc_hashtable*, const void*); extern void objc_hashtable_free(struct objc_hashtable *h); extern void objc_register_selector(struct objc_abi_selector*); extern void objc_register_all_selectors(struct objc_abi_symtab*); extern void objc_unregister_all_selectors(void); extern struct objc_sparsearray *objc_sparsearray_new(uint_fast8_t); extern void *objc_sparsearray_get(struct objc_sparsearray*, uintptr_t); extern void objc_sparsearray_set(struct objc_sparsearray*, uintptr_t, void*); extern void objc_sparsearray_free(struct objc_sparsearray*); extern struct objc_dtable* objc_dtable_new(void); extern void objc_dtable_copy(struct objc_dtable*, struct objc_dtable*); extern void objc_dtable_set(struct objc_dtable*, uint32_t, IMP); extern void objc_dtable_free(struct objc_dtable*); extern void objc_dtable_cleanup(void); extern void objc_init_static_instances(struct objc_abi_symtab*); extern void objc_forget_pending_static_instances(void); extern void __objc_exec_class(struct objc_abi_module*); #ifdef OF_HAVE_THREADS extern void objc_global_mutex_lock(void); extern void objc_global_mutex_unlock(void); extern void objc_global_mutex_free(void); #else # define objc_global_mutex_lock() # define objc_global_mutex_unlock() # define objc_global_mutex_free() #endif static inline IMP objc_dtable_get(const struct objc_dtable *dtable, uint32_t idx) { #ifdef OF_SELUID24 uint8_t i = idx >> 16; uint8_t j = idx >> 8; uint8_t k = idx; return dtable->buckets[i]->buckets[j]->buckets[k]; #else uint8_t i = idx >> 8; uint8_t j = idx; return dtable->buckets[i]->buckets[j]; #endif } #if defined(__ELF__) # if defined(__x86_64__) || defined(__amd64__) || defined(__i386__) || \ defined(__ppc__) || defined(__PPC__) || defined(__arm__) || \ defined(__ARM__) |
︙ | ︙ |