Overview
| Comment: | Properly copy methods from superclass first. |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | runtime |
| Files: | files | file ages | folders |
| SHA3-256: |
8c368f8f383b085fd3a425c4356c8742 |
| User & Date: | js on 2012-04-21 13:05:23 |
| Other Links: | branch diff | manifest | tags |
Context
|
2012-04-21
| ||
| 13:47 | Ensure all selectors are registered before load. (check-in: d5236bb40e user: js tags: runtime) | |
| 13:05 | Properly copy methods from superclass first. (check-in: 8c368f8f38 user: js tags: runtime) | |
| 13:04 | Avoid useless looking for +[load] method. (check-in: c03268e4c6 user: js tags: runtime) | |
Changes
Modified src/runtime/class.m from [aa051ec745] to [7aa459dc9f].
| ︙ | ︙ | |||
112 113 114 115 116 117 118 |
void
objc_update_dtable(Class cls)
{
struct objc_method_list *ml;
struct objc_category **cats;
unsigned int i;
| | < < < < | | > > | 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 |
void
objc_update_dtable(Class cls)
{
struct objc_method_list *ml;
struct objc_category **cats;
unsigned int i;
if (cls->dtable == NULL)
cls->dtable = objc_sparsearray_new();
if (cls->superclass != Nil)
objc_sparsearray_copy(cls->dtable, cls->superclass->dtable);
for (ml = cls->methodlist; ml != NULL; ml = ml->next)
for (i = 0; i < ml->count; i++)
objc_sparsearray_set(cls->dtable,
(uint32_t)ml->methods[i].sel.uid,
ml->methods[i].imp);
|
| ︙ | ︙ |
Modified src/runtime/runtime-private.h from [e12f9f95c1] to [7dea8609ad].
| ︙ | ︙ | |||
144 145 146 147 148 149 150 | extern const void* objc_hashtable_get(struct objc_hashtable*, const char*); extern void objc_hashtable_free(struct objc_hashtable *h); extern BOOL objc_hashtable_warn_on_collision; extern void objc_register_selector(struct objc_abi_selector*); extern void objc_register_all_selectors(struct objc_abi_symtab*); extern void objc_free_all_selectors(void); extern struct objc_sparsearray* objc_sparsearray_new(void); | | > | 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
extern const void* objc_hashtable_get(struct objc_hashtable*, const char*);
extern void objc_hashtable_free(struct objc_hashtable *h);
extern BOOL objc_hashtable_warn_on_collision;
extern void objc_register_selector(struct objc_abi_selector*);
extern void objc_register_all_selectors(struct objc_abi_symtab*);
extern void objc_free_all_selectors(void);
extern struct objc_sparsearray* objc_sparsearray_new(void);
extern void objc_sparsearray_copy(struct objc_sparsearray*,
struct objc_sparsearray*);
extern void objc_sparsearray_set(struct objc_sparsearray*, uint32_t,
const void*);
extern void objc_sparsearray_free(struct objc_sparsearray*);
extern void objc_sparsearray_free_when_singlethreaded(struct objc_sparsearray*);
extern void objc_sparsearray_cleanup(void);
extern void objc_init_static_instances(struct objc_abi_symtab*);
extern void __objc_exec_class(struct objc_abi_module*);
|
| ︙ | ︙ |
Modified src/runtime/sparsearray.m from [a773bc4c5d] to [c1a8aea676].
| ︙ | ︙ | |||
59 60 61 62 63 64 65 | for (i = 0; i < 256; i++) s->buckets[i] = empty_level2; return s; } | > | | < < < | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 |
for (i = 0; i < 256; i++)
s->buckets[i] = empty_level2;
return s;
}
void
objc_sparsearray_copy(struct objc_sparsearray *dst,
struct objc_sparsearray *src)
{
size_t i, j, k;
uint32_t idx;
for (i = 0; i < 256; i++) {
if (src->buckets[i]->empty)
continue;
for (j = 0; j < 256; j++) {
if (src->buckets[i]->buckets[j]->empty)
continue;
|
| ︙ | ︙ | |||
89 90 91 92 93 94 95 | continue; idx = (i << 16) | (j << 8) | k; objc_sparsearray_set(dst, idx, obj); } } } | < < | 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
continue;
idx = (i << 16) | (j << 8) | k;
objc_sparsearray_set(dst, idx, obj);
}
}
}
}
void
objc_sparsearray_set(struct objc_sparsearray *s, uint32_t idx, const void *obj)
{
uint8_t i = idx >> 16;
uint8_t j = idx >> 8;
|
| ︙ | ︙ |