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
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
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
6c9edcb510
Support new NSConstantString format and update tests.
8 years ago
David Chisnall
67cf43c5a2
Add support for class properties in protocols.
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
48967e58f3
Add missing file.
8 years ago
David Chisnall
5148d043d8
Add a test for weak import.
8 years ago
David Chisnall
ee1c6ad661
Fix inefficient ivar offset allocation.
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
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
55a4d763d1
Silence a warning in a test.
...
The test is doing something unsafe, but which we want to work.
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
davidchisnall
b8badbb28e
Merge pull request #63 from Microsoft/assocloss
...
always look beyond the first page of associated objects
8 years ago
Dustin Howett
828e6ebf70
always look beyond the first page of associated objects
...
Without this fix, we would lose associated objects silently after adding
the 11th. We would also allocate full pages for each object after the
11th because we couldn't find empty slots.
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
81f7b16af5
Add a test for e3b069c (association policy)
8 years ago
David Chisnall
7539d7e042
Fix warnings in test.
8 years ago
Dustin Howett
45f6572379
Add a test for a0eec52
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
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
82b3abf93e
Fix test warning on GNU platforms.
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 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
2417ec5806
Remove another unused build-breaking header.
9 years ago
David Chisnall
ece31319b5
Remove an unused header include that was breaking the test build if
...
libobjc is not already installed.
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
Niels Grewe
165f1e83bf
Additional asserts
...
Assert that the offset of `isa` is 0 and the offset of `c_string` is
`sizeof(Class)`
9 years ago
Niels Grewe
8c79eb836c
Test case for misaligned ivars.
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
9a2f43ca7d
Work around the fact that clang 3.4 and earlier emit broken metadata.
...
This is mostly important because Travis-CI uses an archaic version of
clang for the CI runs.
10 years ago
David Chisnall
8c35e72655
Add missing properties and don’t make a runtime-specific test conditional on OS.
10 years ago
David Chisnall
81ef7a9816
Don’t fail the test if we get more attributes than we expect.
...
Attribute lists are not null-terminated, so this would previously have gone off into memory that it was not meant to access.
10 years ago
Niels Grewe
f264fd159d
Fix a segfault on (s|g)etting ivars.
...
When we were trying to get or set an ivar on a class that had
no ivars defined, we'd dereference a NULL ivar list while
determining the ownership qualifier.
10 years ago
David Chisnall
d52db3491a
Make the forwarding test use the forward2 hook.
10 years ago
David Chisnall
b11779dc19
Fix objc_msgSend test with new names for slot structures.
10 years ago
David Chisnall
c3c81796ca
Rework slot handling so that the fields that are used for dispatch are
...
at the start of the structure, making it easier to change the layout in
the future.
Also clean up the growth of various fields and consolidate some of the
metadata into a pointer to the `struct objc_method`.
10 years ago
David Chisnall
f55c158be8
First pass at new Objective-C ABI.
10 years ago
Niels Grewe
a6e65cea04
Fix typo in test function
10 years ago
David Chisnall
4a59b2a986
Set up the new forwarding hook in the objc_msgSend test.
...
This is probably wrong, as we should be calling forward2 if forward3 is not set, but it makes the test pass for now.
10 years ago
David Chisnall
5cf6d6ac13
Make the message send test actually test thing things that it's supposed
...
to.
10 years ago
David Chisnall
8583fc7f61
Explicitly make char signed in the property introspection test. The C spec allows char to be either signed or unsigned. If it’s unsigned (as it is on ARM), then the test will fail with the wrong encoding.
10 years ago
David Chisnall
e8e5f1e254
Try calling the IMP directly before calling it indirectly in the block-as-method test.
...
This makes debugging *much* easier!
10 years ago
David Chisnall
7eeffe9d09
Rewrite the block-to-imp code so that:
...
- We reuse the memory allocated for blocks
- We no longer have the same physical page mapped write and execute
10 years ago
David Chisnall
0a847e10be
Tweak the message sending microbenchmark a bit so that it produces
...
output compatible with ministat.
10 years ago
David Chisnall
2777fea77a
Enable correct behaviour with respect to ARC for objc_{g,s}etIvar().
10 years ago
David Chisnall
57858add6e
Silence warning in test.
10 years ago
David Chisnall
dbdc26523c
Fix the property introspection test some more.
10 years ago
David Chisnall
5c21e73f26
Fix the property introspection test.
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
b581098831
Extend the objc_msgSend test to check for register saving.
...
Ensure, when we bounce out from the assembly into C and back again, that
the argument values are preserved. Tests 10 integer and 10 floating
point arguments, which should cover all of the argument registers and at
least one stack slot on all supported platforms.
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
David Chisnall
794ac2a3ee
Fix copy and paste duplication of a line.
10 years ago
David Chisnall
6a0f909e06
Don't use an obsolete header in a test.
10 years ago
David Chisnall
53bc9f3892
Fix the size of run-time generated root classes.
...
The size of the new class with should be sizeof(Class), not sizeof(struct objc_class).
10 years ago
Niels Grewe
c5ae4432e0
Be more lenient when accepting property encodings produced by clang. Cf. gnustep/libobjc2#5 .
10 years ago
Niels Grewe
1ac152032a
Merge branch 'master' into nil_exception
...
Conflicts:
Test/CMakeLists.txt
10 years ago
Niels Grewe
e121b34a9f
Check other exception handlers that should/shouldn't catch nil.
10 years ago
Niels Grewe
b2e7c50704
Fix throwing nil exceptions.
10 years ago
Niels Grewe
cbacd87632
Add missing changes
11 years ago
Niels Grewe
44627f69e7
Also fix method_getArgumentType(). Add test case.
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
7fde81e9b2
Fix include to work with make.
13 years ago
theraven
f50bc6cf33
Added support for tracing message sends to the runtime.
...
Currently x86-64 only.
13 years ago
theraven
3b9bbf296d
Fixed property introspection test for the more-expressive strings that clang
...
now produces.
This test is now expected to fail with slightly older clang.
13 years ago
theraven
c346ff1088
More header cleanups in the tests.
13 years ago
theraven
074fd1da56
Add path to Test.h to help Make builds.
13 years ago
theraven
193629d8a2
Fix a bug with blocks in ARC mode being incorrectly released.
13 years ago
theraven
57a9acb13c
Some test case cleanups.
13 years ago
theraven
58a574b34f
Fixed a great many property introspection bugs and added test case.
...
Test case by Jean-Charles Bertin!
13 years ago
theraven
0e90d9645d
Tweak the ManyManySelectors test case so that it doesn't hit a pathological
...
case in the selector hashing function and use insane amounts of memory.
13 years ago
theraven
eb234ea26a
Fix the case where the number of selectors grows to more than 2^16 and we need
...
to fall back to 3-level dtables.
Added a test case that registers far more selectors than a sane program
contains and tries to use them.
13 years ago
theraven
fb2e6756f6
Fix (and add test case for) a bug where objc_allocateClassPair() failed if the
...
superclass had not yet been loaded.
13 years ago