10 Commits (9206f48bce61478c6fb845a0e30d7dd68930175e)

Author SHA1 Message Date
David Chisnall 377a81d237 Add support for fast-path alloc / init methods and direct methods.
The fast paths follow the pattern that we established for fast ARC:
Framework base classes can opt in by implementing a `+_TrivialAllocInit`
method.

This opt-in behaviour is inherited and is removed implicitly in any
subclass that implements alloc or init methods (alloc and init are
treated independently).

Compilers can emit calls to `objc_alloc(cls)` instead of `[cls alloc]`,
`objc_allocWithZone(cls)` instead of `[cls allocWithZone: NULL]`, and
`objc_alloc_init` instead of `[[cls alloc] init]`.

Direct methods don't require very much support in the runtime.  Apple
reuses their fast path for `-self` (which is supported only in the Apple
fork of clang, not the upstream version) for a fast init.  Given that
the first few fields of the runtime's class structure have been stable
for around 30 years, I'm happy moving the flags word (and the
initialised bit, in particular) into the public ABI.  This lets us do a
fast-path check for whether a class is initialised in class methods and
call `objc_send_initialize` if it isn't.  This function is now exposed
as part of the public ABI, it was there already and does the relevant
checks without invoking any of the message-sending machinery.

Fixes #165 #169
2 years ago
David Chisnall 6c9edcb510 Support new NSConstantString format and update tests. 8 years ago
David Chisnall db5d8f7f64 Don't compile Test.m 122 times.
All tests now link one of a small number of .o files compiled from Test.m.
8 years ago
David Chisnall 1f2d35006b Make the ObjC++ interop test compile 8 years ago
David Chisnall a74542ae4f Add a test that hidden classes are correctly deallocated and don’t leave the runtime in an undefined state. 11 years ago
theraven 2c81ee0428 Allow ARC to correctly handle references to self from blocks within -dealloc. 12 years ago
theraven 2d0ae6b79b Add test for associated objects. 12 years ago
theraven f50bc6cf33 Added support for tracing message sends to the runtime.
Currently x86-64 only.
13 years ago
theraven 074fd1da56 Add path to Test.h to help Make builds. 13 years ago
theraven 63bdbc9440 Add another missing file... 13 years ago