Differences From Artifact [584f60ba59]:
- File
src/runtime/lookup.m
— part of check-in
[dcf845546a]
at
2012-05-09 13:55:09
on branch runtime
— Initialize classes on the first dispatch.
This is no longer done in objc_msg_lookup() and thus allows direct class
references. (user: js, size: 2432) [annotate] [blame] [check-ins using] [more...]
To Artifact [34d39a737b]:
- File src/runtime/lookup.m — part of check-in [8892ae9fcc] at 2012-07-12 01:28:46 on branch trunk — Don't access isa directly. (user: js, size: 2501) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
24 25 26 27 28 29 30 | #import "macros.h" IMP (*objc_forward_handler)(id, SEL) = NULL; IMP objc_not_found_handler(id obj, SEL sel) { | | > | | | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | #import "macros.h" IMP (*objc_forward_handler)(id, SEL) = NULL; IMP objc_not_found_handler(id obj, SEL sel) { if (!(object_getClass(obj)->info & OBJC_CLASS_INFO_INITIALIZED)) { BOOL is_class = object_getClass(obj)->info & OBJC_CLASS_INFO_METACLASS; Class cls = (is_class ? (Class)obj : object_getClass(obj)); objc_initialize_class(cls); if (!(cls->info & OBJC_CLASS_INFO_SETUP)) { if (is_class) return objc_msg_lookup(nil, sel); else |
︙ | ︙ | |||
51 52 53 54 55 56 57 | return objc_msg_lookup(obj, sel); } if (objc_forward_handler != NULL) return objc_forward_handler(obj, sel); ERROR("Selector %s is not implemented for class %s!", | | | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | return objc_msg_lookup(obj, sel); } if (objc_forward_handler != NULL) return objc_forward_handler(obj, sel); ERROR("Selector %s is not implemented for class %s!", sel_getName(sel), object_getClassName(obj)); } BOOL class_respondsToSelector(Class cls, SEL sel) { if (cls == Nil) return NO; |
︙ | ︙ | |||
79 80 81 82 83 84 85 | objc_msg_lookup(id obj, SEL sel) { IMP imp; if (obj == nil) return (IMP)nil_method; | | > | 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | objc_msg_lookup(id obj, SEL sel) { IMP imp; if (obj == nil) return (IMP)nil_method; imp = objc_sparsearray_get(object_getClass(obj)->dtable, (uint32_t)sel->uid); if (imp == NULL) return objc_not_found_handler(obj, sel); return imp; } |
︙ | ︙ |