59 Commits (61c7414fed66fe7cce05fc53be825dc03f625e3c)

Author SHA1 Message Date
David Chisnall 0da21d5064 Add some more Windows build tweaks.
This enables building on Windows with Ninja.
7 years ago
David Chisnall bab334acd4 Fix cmake configuration for Windows builds. 8 years ago
David Chisnall aa558900bd Fix an off-by-one error in the hash table.
When removing a hash entry that was in the cell assigned to its hash, we
would clear the first bit in the second maps.  If this entry was a
secondary value with the same hash, then this value became unreachable.

This very rarely showed up for two reasons.  First, most of the tables
are insert-only and so we never try to remove things from them.  Second,
it requires a particular sequence of inserts.  It occasionally caused
weak references to be susceptible to use after free.
8 years ago
David Chisnall 934cd13a7a Initial pass at Windows support.
All tests now pass with the new ABI on x86-64, with the new ABI.  Some
of the code is ugly and other platforms are probably broken.
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 2934a98503 Support building without support for old ABIs. 8 years ago
David Chisnall b81df02b91 Merge branch 'master' into newabi
Simplify the setSubclass dtable updating mechanism.
8 years ago
David Chisnall bfe9475204 Add constant string test. 8 years ago
David Chisnall 5148d043d8 Add a test for weak import. 8 years ago
David Chisnall ab84589b5d Improve protocol method metadata.
Methods now include a selector and extended type encoding, rather than a
method name and lgacy type encoding.  Older ones are auto-upgraded.

Expose the extended type encoding via a function that JavaScriptCore
expects to exist.
8 years ago
David Chisnall 45d0b8e4c9 Add support for registering aliases.
Also add a test.
8 years ago
David Chisnall 33dc69387e Add test for category methods replacing class methods. 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
Dustin Howett 7fb4f5684f Merge remote-tracking branch 'upstream/master' into HEAD 8 years ago
Dustin Howett 14cb893509 Add a test for class_setSuperclass 8 years ago
Dustin Howett 45f6572379 Add a test for a0eec52 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 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 760bb785aa Rename files.
minRep is not actually an informative name for a test case.
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 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 79395aebec Refactor test cmake to reduce copying and pasting.
Also ensures that multi-file tests are run in all combinations.
8 years ago
David Chisnall a54272c1ab Merge origin/master into newabi (using imerge) 8 years ago
David Chisnall 0b5f66393a Add test for #32. 9 years ago
David Chisnall e87b5c1503 Remove an assertion that was useful in debugging, but not actually
correct.

Instance variables are not normally zero-sized, but some are.  Examples
include zero-length arrays at the end of a class, and bitfields.

Fixes #30
Fixes #31
9 years ago
David Chisnall 12d1ea62a4 Merge branch 'master' into newabi 9 years ago
David Chisnall d1eb9ad91e Ensure that asserts in the tests are still run, even in a release build.
Fixes #29
9 years ago
David Chisnall 4fd27a066f When moving ivars to increase their alignment, make sure later ivars are
also moved.

Fixes #27
9 years ago
David Chisnall 6df23377a0 Forcibly realign instance variables to take into account the padding
from the reference count.
9 years ago
David Chisnall f55c158be8 First pass at new Objective-C ABI. 10 years ago
David Chisnall 2777fea77a Enable correct behaviour with respect to ARC for objc_{g,s}etIvar(). 10 years ago
David Chisnall b5e12e914c Make PropertyIntrospectionTest2 use arc.
Recent versions of clang object to weak properties in non-ARC mode.
10 years ago
David Chisnall 8b1d4fbcc2 TEST is a keyword in if() statements in recent CMake, rename a variable to avoid a conflict. 10 years ago
David Chisnall 3135e30d71 Fix ARC assignment of blocks.
We were not correctly checking that the object being assigned had a
reference count in the object header.  We're also now avoiding assigning
small objects to the weak reference table, which is quite important as
they have no destructor.

Fixes #12
10 years ago
Niels Grewe 1ac152032a Merge branch 'master' into nil_exception
Conflicts:
	Test/CMakeLists.txt
11 years ago
Niels Grewe b2e7c50704 Fix throwing nil exceptions. 11 years ago
Niels Grewe cbacd87632 Add missing changes 11 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 bd0728f393 Fix a bug in weak reference handling, where weak refers were being removed from
the table incorrectly, causing objects inserted at offsets due to hash
collisions to fail to be moved up and then fail to be found later.

Test by Eric Wasylishen!
12 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 edeb64095d Disable the failing test until it can be fixed properly. 13 years ago
theraven 16bfdc8ee6 Align ivars to 16 byte boundaries when they are larger than a pointer. This is
currently overly defensive.

Add a test case for this realignment.
13 years ago
theraven f50bc6cf33 Added support for tracing message sends to the runtime.
Currently x86-64 only.
13 years ago
theraven 193629d8a2 Fix a bug with blocks in ARC mode being incorrectly released. 13 years ago