Differences From Artifact [9ff82b2e4e]:
- File src/runtime/lookup.m — part of check-in [f5747ff94a] at 2012-05-09 13:54:48 on branch runtime — Better way of calling the forwarding handler. (user: js, size: 1734) [annotate] [blame] [check-ins using]
To 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...]
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 37 | #import "macros.h" IMP (*objc_forward_handler)(id, SEL) = NULL; IMP objc_not_found_handler(id obj, SEL sel) { if (objc_forward_handler != NULL) return objc_forward_handler(obj, sel); ERROR("Selector %s is not implemented for class %s!", sel_getName(sel), obj->isa->name); } | > > > > > > > > > > > > > > > > > > > > > > > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #import "macros.h" IMP (*objc_forward_handler)(id, SEL) = NULL; IMP objc_not_found_handler(id obj, SEL sel) { if (!(obj->isa->info & OBJC_CLASS_INFO_INITIALIZED)) { BOOL is_class = obj->isa->info & OBJC_CLASS_INFO_METACLASS; Class cls = (is_class ? (Class)obj : obj->isa); objc_initialize_class(cls); if (!(cls->info & OBJC_CLASS_INFO_SETUP)) { if (is_class) return objc_msg_lookup(nil, sel); else ERROR("Could not dispatch message for " "incomplete class %s!", cls->name); } /* * We don't need to handle the case that super was called. * The reason for this is that a call to super is not possible * before a message to the class has been sent and it thus has * been initialized together with its superclasses. */ 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), obj->isa->name); } |
︙ | ︙ |