988 Commits (93b3f889a6cd6bb7a008463e5334b5153d7a87a0)
 

Author SHA1 Message Date
David Chisnall 93b3f889a6 Update documentation. 8 years ago
David Chisnall a8752cd842 Clean up method / slot lookup interfaces. 8 years ago
David Chisnall a9a2ed6b10 Refactor to use `objc_method` as the slot.
This change set incorporates a number of changes that all needed to
happen together:

 * The imp is now the first field of the `objc_method` structure.  This
   makes it possible to extend the structure without breaking anything
   that relies on being able to access the IMP.
 * There is no owner in the slot, so we must use other mechanisms for
   determining the owner of a method (e.g. whether the same method appears
   in the superclass)
 * Again, because there is no owner in the slot, we can't use this as a
   fast path for finding the C++ construct / destruct methods.  These are
   now cached in the class structure when they are found.
 * The version field is gone from the slot and now we provide a global
   version.  This is based on the observation that method replacements
   are relatively infrequent and the overhead of invalidating all method
   caches is cheaper than adding extra state for every (class, method)
   pair.
 * A number of the runtime functions are simplified because replacing
   the IMP in a `Method` now implicitly updates the dtable.
8 years ago
David Chisnall 33dc69387e Add test for category methods replacing class methods. 8 years ago
David Chisnall 314a4167ca Remove low memory profile.
This hasn't been tested for a long time and probably doesn't work.
8 years ago
David Chisnall 0964d63ba9 Update for the compiler / linker setting up superclass pointers.
In the legact ABI, superclass pointers are initially set to strings
containing the superclass name and the runtime fixes them up.  In the
new ABI, the compiler sets up the linkage directly.
8 years ago
David Chisnall f3386c530e Add asserts that we don't see extended type encodings in selectors.
It might be a good idea to handle user-provided extended type encodings,
but for now we just abort.
8 years ago
David Chisnall ccb8627765 Don't leak extended type encodings in slot access. 8 years ago
David Chisnall 6c1fc86f01 Clean up a condition.
Skip adding the null capability.
8 years ago
David Chisnall 5a9c65553f Always use selector type for method type encodings.
In the new ABI, we use the legacy type encoding in the selector and the
extended type encoding in the types field.  We want to only expose the
legacy type encoding through existing APIs.
8 years ago
David Chisnall 4f71429bec Add support for parsing extended type encodings.
Extended type encodings add more detailed information to object and
block types:

* Objects are encoded as @"ClassName".
* Blocks are encoded as @?<parameter type signature>

In the new ABI, we use classic type encodings for selectors and extended
type encodings everywhere else.
8 years ago
David Chisnall 55a4d763d1 Silence a warning in a test.
The test is doing something unsafe, but which we want to work.
8 years ago
David Chisnall 44a85a401a Add size to the property list.
It should now be possible to support newer ABIs.
8 years ago
David Chisnall 8b6793aa52 Add a test for forward declared protocols.
Check that a protocol accessed by forward definition in one compilation
unit is the one defined in another compilation unit.
8 years ago
David Chisnall 1dfa6a6785 Explicitly reference a protocol in a test.
With the old ABI, we generated a copy of every protocol in every
compilation unit that declared it.  We now emit protocols only if they
are referenced (and have the linker deduplicate them).

This test was previously failing with the Apple runtime.
8 years ago
David Chisnall 12a0d97849 Add protocol references in the loader.
These are currently ignored, because they are only important when the
runtime has upgraded the protocol.  The runtime will upgrade legacy
protocols, but they are not referenced by this indirection layer.
8 years ago
David Chisnall 8789016b21 Improve a comment. 8 years ago
David Chisnall 959fabbfec Fix typo. 8 years ago
David Chisnall c94357e8a3 Add missing include. 8 years ago
David Chisnall 9718ce247d Initial start of documenting the ABI. 8 years ago
David Chisnall 80a02b3b79 Add a size field to the method list. 8 years ago
David Chisnall 64a8302712 Delete some now-dead code. 8 years ago
David Chisnall 5b0f05e6e0 Fix ivar offset calculation with alignment.
When upgrading legacy ivars, pick a sensible guess.
When calculating ivar offsets, use the supplied alignment.
8 years ago
David Chisnall f91fb2e745 Checkpoint more work on new ABI.
We're now using a new class and category structure and auto-upgrading the old ones.  Other changes:

- The Ivar structure now points to the ivar offset variable, so we can more easily find it.
- Categories can now add properties.
8 years ago
David Chisnall 09dda1837f Add test for properties in categories. 8 years ago
David Chisnall 9f83f1639f Fix traversal of the resolved class list.
This probably didn't make a difference, but if we ended up
resolving a class as a result of resolving a subclass, then we'd previously go and explore an unrelated linked list for a bit.
8 years ago
David Chisnall ea5f2920e8 Small cleanups.
Technically, this was undefined behaviour, but it probably worked on most targets.
8 years ago
David Chisnall 7b8e741f39 Remove a test for a thing that was false.
There is no guarantee that two selectors will be equal.
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 91a1baae48 Fix errors made in merging. 8 years ago
David Chisnall 76e7d4b07f Merge branch 'master' into newabi 8 years ago
David Chisnall 587cf3f27b Another try at making CMake work. 8 years ago
David Chisnall bb78abb662 Fix copy and paste type. 8 years ago
David Chisnall 7832765112 Improve detection of libsupc++ 8 years ago
David Chisnall dc9b8313a4 Rework C++ library detection.
macOS ships with libc++abi, which doesn't provide the hooks required
for interop, so this was causing all of the tests to fail to link in
the Travis macOS test.  We're now correctly detecting that it won't
work on macOS and disabling those tests.
8 years ago
David Chisnall fefb333b01 Remove the separate libobjcxx.
If we don't find a separate dynamically linkable C++ runtime, then
depend on the C++ standard library implementation.
8 years ago
David Chisnall 82b3abf93e Fix test warning on GNU platforms. 8 years ago
David Chisnall 7bd78e5b46 Fix a bug in ObjC++ EH.
Throwing an Objective-C exception through a C++ catch block was broken.
This was because the C++ code inserts a cleanup handler to make sure
that it invokes `__cxa_end_catch`.  Unwinding through this catchup
transformed the Objective-C exception into a C++ one.  This case should
have been handled, except for two bugs:

1. A typo (`#ifdef` instead of `#ifndef`) meant that we were not
   extracting the Objective-C exception from the C++ object.
2. We were skipping everything except catchalls after the search phase,
   because we lose some information in the transformation.

Fixes #49
8 years ago
David Chisnall f6709519fa Simplify test case some more.
It appears that the problem occurs when throwing an Objective-C
exception through and Objective-C++ frame.
8 years ago
David Chisnall 760bb785aa Rename files.
minRep is not actually an informative name for a test case.
8 years ago
David Chisnall 9115a909b1 Delete more code.
The reduced test case is now fairly close to minimal.
8 years ago
David Chisnall 8f03e62a84 Delete a lot of redundant code. 8 years ago
David Chisnall 1f2d35006b Make the ObjC++ interop test compile 8 years ago
David Chisnall 9760ae8d48 Merge pull request 50 with test case for exception issue. 8 years ago
David Chisnall 24f3713a4b Fix a bug in weak ref handling.
Weak refs were being left as dangling pointers after being deleted.  The
load that caused the deallocation would return nil, but then the next
one would dereference a dangling pointer.
8 years ago
David Lobron c036265ece Remove changes introduced accidentally because I was using an older
version of this file (sync with 0b5f66393a).
8 years ago
David Lobron 44d05e58a6 Minimal reproducing test case. This creates a test number 47 in the unit
test suite, which fails with an exception.  The exception reproduces the
bug.
8 years ago
David Chisnall 2542638b23 Add a warning to the announcement. 8 years ago
David Chisnall 6d9f2a6586 Add some release announcement text. 8 years ago
David Chisnall 12b820cb99 Add refcount accessor function. 8 years ago