714 Commits (dbe4ed41fa5ee1ee6b81a51f5579503903f630b7)
 

Author SHA1 Message Date
theraven ffc661fe5c Export capabilities for associated references and GC. 15 years ago
theraven 2d493697a6 Work around PyObjC's stupid abuse of the message-send-to-super mechanism. 15 years ago
theraven 3219a530d6 Don't call byref keep / dispose when they don't exist. 15 years ago
theraven dfbf18cc67 Fixed <= bug in weak references. We're storing the EXTRA retain count, not the refcount. 15 years ago
theraven 61a7c53a08 Handle NULL arguments to block copy / release. 15 years ago
theraven 83db079968 Fix bug in fast path for class_getInstanceMethod() 15 years ago
theraven 65d6a8dfb5 When changing the size of structures, it's a good idea to make sure that you change everything that depends on those sizes too... 15 years ago
theraven 4e7b476aa6 Change [1] to [] for variable length structure elements (C99 - silences array out of bounds errors).
Added fields to the end of the class structure for strong / weak ivar bitmaps (not yet generated by any compiler).

Fixed definition of __sync_swap() so that it works on GCC again.
15 years ago
theraven 219f921bc3 Fix some bugs in class_getInstanceMethod() 15 years ago
theraven e69ed0696d Better recovery when things are done in the wrong order. 15 years ago
theraven 3754c9fdbe Accidentally deleted class declaration for Protocol2. Add it back. 15 years ago
theraven 5448596ace Update Makefile. 15 years ago
theraven 3a27521f57 Add flag for identifying modules that use ARC. 15 years ago
theraven e0ae8ce474 Another 64-bit issue. 15 years ago
theraven 33864e9676 Fix int -> size_t, causing breakage on 64-bit big-endian platforms. 15 years ago
theraven 52fb301a45 Move return statement into the conditional, where it belongs. 15 years ago
theraven e8583bf4ae Updated README to give some more information about ARC. 15 years ago
theraven 0b9e0fd295 Added fast implementation of autorelease pools for ARC. 15 years ago
theraven a255dcd2d1 ...and fix dereferencing of NULL pointer introduced with last commit. 15 years ago
theraven e7a6be5584 Tighten up loading of __weak variables slightly. 15 years ago
theraven 69e53c4cdb Better test for presence of __sync_swap(). 15 years ago
theraven 893b9bf958 Add guard if __has_feature is not defined. 15 years ago
theraven d61e9b3209 Fix __weak references to blocks. 15 years ago
theraven 126aa409cb op_and_fetch, not fetch_and_op! 15 years ago
theraven 663995f08c Small cleanup. Use the ARC functions for retain / release / autorelease messages everywhere. This will make properties faster if we're using an ARC-compatible NSObject. 15 years ago
theraven 61bc10ad4c Remove debugging line accidentally committed. 15 years ago
theraven 73891aaecc Two small ARC fixes:
- Make objc_retain() check for stack blocks and implicitly copy them.  This fixes the case where a block pointer is stored in an object-typed variable and is assigned.
- Tweak objc_retainAutoreleaseReturnValue() so that the ARC optimiser doesn't detect that the body looks like a call to objc_retainAutoreleaseReturnValue() and replace it with an infinitely recursive call.

The second fix now means that arc.m will compile with clang without producing a function that calls itself.
15 years ago
theraven fce7c776b6 Tweak build to only enable optimisation in non-debug builds. 15 years ago
theraven 9b9c801805 Fix off-by-one error in buffer.h 15 years ago
theraven 9d6154041c Make sure that autoreleased returned objects are destroyed when the autorelease
pool is destroyed.  They were previously being destroyed on thread termination,
this ensures that their lifespan is predictable.
15 years ago
theraven 7155f174b7 Don't enable incremental collection. It seems to cause crashing. 15 years ago
theraven aaeb22d682 Updated README to briefly describe ARC. 15 years ago
theraven 79e29ba48f Copied ANNOUNCE to ANNOUNCE.1.5 in preparation for 1.5 release. 15 years ago
theraven f6923d7472 Improve objc_moveWeak() implementation. 15 years ago
theraven 7b6ba21ce5 Small bug fixes:
- Don't call C++ constructors if they don't exist.
- Don't check the owner of retain / release methods if they are not implemented.
- Add arc.m as a file to ignore when checking for GC compatibility.
15 years ago
theraven e34be81404 Fix fast-path test to work with subclasses correctly. 15 years ago
theraven 81131acfbc Fix LLVM trunk compatibility. 15 years ago
theraven 34f7baf8d7 Added a fast path for ARC. Now, if a class implements ARC-compatible retain / release / autorelease methods, we don't call them at all. Instead, we inline them in the ARC accessors. This avoids all of the overhead of the message send (lookup and call) and should make ARC quite a bit faster than manual reference counting. 15 years ago
theraven 6a37a8c3bc More ARC tweaks. 15 years ago
theraven 55191e34ae Fix the fast path. It should fall back to doing what the slow path does if the other half is not using it. 15 years ago
theraven 3e88293f74 Added mention of ARC to ANNOUNCE. 15 years ago
theraven e3c836b090 Added fast path for objc_autoreleaseReturnValue() and objc_retainAutoreleasedReturnValue().
In a simple example:

- foo { return self; }

void someFunction(void)
{
	id a = foo;
	...
}

In ARC mode, this expands to:

- foo { return objc_retainAutoreleaseReturnValue(self); }

void someFunction(void)
{
	id a = objc_retainAutoreleasedReturnValue(foo);
	...
}

In the slow path, this is equivalent to:

- foo { return [[self retain] autorelease]; }

void someFunction(void)
{
	id a = [foo retain];
	...
	[a release];
}

The fast path skips the autorelease / retain pair.  The return value is stored
in thread-local storage temporarily and then retrieved, the retain balancing
out the autorelease.

This gives a 50% speedup on a single thread.  It also avoids some atomic
operations.
15 years ago
theraven 36d21882ec Documented objc-arc.h 15 years ago
theraven bc87ed22e1 Implemented support for __weak with ARC.
ARC functions are all now exposed in a header, but not yet documented.  See the ARC ABI spec for now:

http://clang.llvm.org/docs/AutomaticReferenceCounting.html#runtime
15 years ago
theraven 065531b12e Remove accidentally-committed WIP ARC code. 15 years ago
theraven b633338a7a Remove indirection from alias table. 15 years ago
theraven 9967d85d60 Fixes to be blocks runtime. Make sure that objects are not prematurely deallocated if referenced by multiple blocks. 15 years ago
theraven 9b70b22eee Use __unsafe_unretained instead of const for returning protocol arrays. Let's not break everyone's code, even if we really want to. 15 years ago
theraven b5380d50d3 Added support for ARC.
Weak references are still not supported, but code that doesn't use them (i.e. any code that wants to be compatible with OS X 10.6) will work fine.

The current implementation is VERY inefficient and has a large number of missed optimisation opportunities: this is the 'make it right' phase, and should be almost equivalent to explicit retain / release code.
15 years ago
theraven 6412c7a4e7 And another one... 15 years ago