1075 Commits (24984bffc5bb0ebd04b9acd2d3574d9bc88fbe97)
 

Author SHA1 Message Date
David Chisnall 24984bffc5 Merge branch 'master' into newabi
No functionality change, some of the fixes from this branch have been
back-ported to master and this merge is just to fix up the history.
8 years ago
David Chisnall a5a0f70a03 Unregister classes when deleting them.
Coverage checking of the test suite showed that objc_disposeClassPair
wasn't tested at all, which then led to discovering that it didn't
unregister the class.
8 years ago
David Chisnall 554c6623dc Back-port constant string test from newabi branch. 8 years ago
David Chisnall f2b5988596 Add constant string test. 8 years ago
David Chisnall 0828b11125 Improve ARC test and fix bugs it uncovered.
This cleans up handling of objects that are not reference counted and
makes their interactions with ARC more consistent.  We should probably
generalise this somewhat - it currently special cases NSConstantString
and NSGlobalBlock, but it would be nice to have an API for constant
objects.
8 years ago
David Chisnall ca1d45a4e6 Fix dangling reference in weak ref code.
Another test added as a result of coverage analysis.
8 years ago
David Chisnall d89a1cafb7 Improve protocol test coverage. 8 years ago
David Chisnall 0c9ee8b920 Improve protocol tests and fix bugs.
Also add the new protocol_getProperties2 function.
8 years ago
David Chisnall 8eb06a3b15 Improve ARC test and fix bugs it uncovered.
This cleans up handling of objects that are not reference counted and
makes their interactions with ARC more consistent.  We should probably
generalise this somewhat - it currently special cases NSConstantString
and NSGlobalBlock, but it would be nice to have an API for constant
objects.
8 years ago
David Chisnall 2e32888296 Remove profiling support.
This was used with an old LLVM pass to perform speculative inlining.  It
is no longer maintained and this code hasn't been tested at all for
years or with nontrivial examples ever.
8 years ago
David Chisnall 4973b8d58a Dom't build an unused private function.
This is useful when debugging, but it's not used by default.
8 years ago
David Chisnall b37815caf7 Remove unreachable case statement. 8 years ago
David Chisnall c6aaf560c1 Fix dangling reference in weak ref code.
Another test added as a result of coverage analysis.
8 years ago
David Chisnall 29a35ab8ba Set profiling environment variable when tests are run.
This has no effect most of the time, but if the runtime is built with
llvm-cov support, then this will cause each test to emit a .profraw
file, which can be merged with:

$ llvm-profdata merge -sparse Test/*.profraw -o libobjc.profdata

This can then be used to generate coverage reports from the test suite
and find code paths that are not currently being tested.
8 years ago
David Chisnall c865b519b0 Unregister classes when deleting them.
Coverage checking of the test suite showed that objc_disposeClassPair
wasn't tested at all, which then led to discovering that it didn't
unregister the class.
8 years ago
David Chisnall c9e8743095 GC some dead code and move another legacy-compat file under the correct
option.
8 years ago
David Chisnall d4b1866170 Remove stale file. 8 years ago
David Chisnall 2934a98503 Support building without support for old ABIs. 8 years ago
David Chisnall 0f1385e1b1 Correctly upgrade categories.
This was hidden by a compiler bug where the new version was generated in
the same format as the old, so upgrading in the wrong place worked.
8 years ago
David Chisnall d11a0311e0 Add checks to prevent mixing incompatible ABI versions. 8 years ago
David Chisnall b81df02b91 Merge branch 'master' into newabi
Simplify the setSubclass dtable updating mechanism.
8 years ago
David Chisnall 8021533d4c Don't allocate objects of size 0.
There's nowhere for the class pointer, so there's nothing that you can
do with them.
8 years ago
David Chisnall 2bdf85ee50 Add missing isa pointer.
This test was accidentally passing sometimes, with the isa pointer being
set using some bit of memory in inter-object padding.  This breaks
horribly with an allocator that packs objects densely.
8 years ago
David Chisnall a4f97f7563 Refactor locking in setSuperclass.
Now all lock ownership is tied to scopes, so will be released correctly
in all return paths.
8 years ago
David Chisnall 00d23b0013 Fix LOCK_SCOPE to allow multiple locks per scope. 8 years ago
davidchisnall fd526bc31f
Merge pull request #70 from Microsoft/css_deadlock
Let go of the runtime lock properly in class_setSuperclass
8 years ago
Dustin Howett d32bafc6e1 Let go of the runtime lock properly in class_setSuperclass 8 years ago
Jason Barmparesos 682717b08d Clang++ provides its own exception types on Linux. (#68)
Fix type of `__cxa_allocate_exception` with recent libsupc++.

Recent versions of GNU libsupc++ provide a definition of `__cxa_allocate_exception` that has a `noexcept` qualifier.  This is sensible (if allocating an exception throws an exception, then something is badly wrong) but it not what the ABI spec says.  We provide our own definition of this, which must match another if provided.

This wouldn't normally be a problem, but recent libstdc++ headers appear to leak libsupc++ headers into the namespace, so we're seeing these definitions even without explicitly including any C++ ABI-related headers.
8 years ago
David Chisnall c50db7b1fe Remove debug log message. 8 years ago
David Chisnall 6c9edcb510 Support new NSConstantString format and update tests. 8 years ago
David Chisnall aba97e11b4 Fix ivar_ownership type name. 8 years ago
David Chisnall 67cf43c5a2 Add support for class properties in protocols. 8 years ago
David Chisnall 040114dff1 Remove some obsolete documentation. 8 years ago
David Chisnall c1391b5079 Add test for class property in category. 8 years ago
David Chisnall aba7e406ff Add test for class properties. 8 years ago
David Chisnall bfe9475204 Add constant string test. 8 years ago
David Chisnall 4891eb9d5f Document a bit more of class structure and of type encodings. 8 years ago
David Chisnall b51e9e9c4c Add method markers. 8 years ago
David Chisnall 48bae5879e Finish documenting instance variables. 8 years ago
David Chisnall 7c4711c141 Add some more documentation. 8 years ago
David Chisnall 41f33508aa Whitespace. 8 years ago
David Chisnall 11637010ad Rename method_list.h to method.h
Work around the fact that LaTeX really doesn't like file names with
underscores...
8 years ago
David Chisnall c0f56a75a0 Modify ivar flags.
Add a flag to indicate that instance variables have an extended type
encoding.

Remove the alignment field and replace it with 6 bits from the flags
field.  We only support power of two alignments, so we may as well store
them in log form, which means we can save a field.  Note that this
doesn't actually save us any space except on 32-bit platforms, because
alignment means that we end up with extra padding at the end of the
struct.
8 years ago
David Chisnall ccefff241a Update obsolete comment. 8 years ago
David Chisnall 20b016c47b Reserve some class flag bits.
These are free for the compiler to be able to use in future ABI
versions.
8 years ago
David Chisnall 4036a88936 Remove separate flags for class and metaclass.
Every class is either a class or a metaclass, it doesn't make sense to
use two flags to store one bit of data.

Also remove the newabi flag from classes in the v2 ABI, where it's
redundant.
8 years ago
David Chisnall c4ff744620 Audit the runtime for direct access to variable-sized arrays.
Several of the structures now end with an array of structures that may
have other fields added to them that the runtime doesn't know about yet
by a compiler.  Rather than indexing into them directly, we must call an
accessor to find the correct address.

A few of the places where accesses were replaced were in functions where
it is safe because they only deal with versions of the structures that
are dynamically allocated (and will therefore have the correct size).
This was done to simplify future auditing: these fields should be
accessed directly only from the accessor functions in the header and
from the upgraders (currently in legacy.c).

Also fix a few bugs where the sizes weren't being filled in.
8 years ago
David Chisnall 64ab2d51f5 Rename legacy types.
For consistency, each now has a `_gcc` or `_gsv1` suffix indicating
whether they were inherited from the GCC or GNUstep v1 ABI.
8 years ago
David Chisnall 48967e58f3 Add missing file. 8 years ago
David Chisnall 5148d043d8 Add a test for weak import. 8 years ago