1328 Commits (d0d28b8f9df02db471e6a39b5b78358ab07ad753)
 

Author SHA1 Message Date
David Chisnall b1964451e1 Fix the AArch64 small object class lookup.
This was generating a relocation that didn't do the right thing and
didn't raise linker errors.  Now it is using GOT-relative addressing.

In combination with the last two commits, this now makes all of the
objc_msgSend tests pass on AArch64.

Fixes #105
6 years ago
David Chisnall c1a3d8f470 Fix stack resetting for objc_msgSend on ARM.
If we called into C to find the IMP (e.g. for forwarding), we were then
reloading all of the arguments but failing to adjust the stack pointer
by the correct amount, leaving it around 192 bytes offset from its
correct location.  This, unsurprisingly, led to crashing and other
exciting behaviour.
6 years ago
David Chisnall 60a657fbc6 Fix CFA calculation in AArch64 objc_msgSend.
Prior to this, throwing an exception from a +initialize method would
leave the stack pointer 16 bytes offset from its correct location.
6 years ago
David Chisnall 469d616a77 [NFC] Fix comment. 6 years ago
David Chisnall 4482919e09 Fix an issue with `WeakRef`s being over-released
As an optimisation, on load of a weak reference we check if the object
has already been deallocated and, if so, decrement the weak reference
count and zero the pointer to the weak reference structure so that the
next check is faster and doesn't need to hold locks for as long.

Unfortunately, the prior implementation of this instead decremented the
weak reference count and then only zeroed the pointer if the reference
count reached zero.  This meant that loading the same __weak pointer
twice after the pointed-to object had been deallocated would decrement
the reference count twice.
6 years ago
David Chisnall 2fb1194cec Add test case for weak ref issue.
This test now fails deterministically, which should make fixing it
easier.
6 years ago
David Chisnall b7021f7488 Merge remote-tracking branch 'origin/master' into arc-cxx 7 years ago
David Chisnall 8809f0122e Fix memory corruption with weak references.
When removing a WeakRef from the map, we use its obj field to find the
key, but the obj field has already been zeroed by this point and so we
end up leaving dangling pointers in the map.
7 years ago
David Chisnall 336d8a828c Fix test failure.
This bug is also present in the original version:

When removing a WeakRef from the map, we use its obj field to find the
key, but the obj field has already been zeroed by this point and so we
end up leaving dangling pointers in the map.
7 years ago
David Chisnall 066a4e65a9 Another go at fixing Cirrus... 7 years ago
David Chisnall af55c29007 Fix the build on Windows. 7 years ago
David Chisnall a04d0e8547 Attempt to make submodules work with cirrus. 7 years ago
David Chisnall 824135cc54 Tell Azure CI to get submodules. 7 years ago
David Chisnall de9f74015f Fix warning. 7 years ago
David Chisnall 3f38f691af Rework ARC code as C++.
Move the weak references hash table to use a well-tested third-party
implementation instead of the hand-rolled version.
7 years ago
David Chisnall e1c10af124
Merge pull request #113 from triplef/fix-android-cxx-runtime-check
Pass on Android toolchain flags for CXX runtime check.
7 years ago
Frederik Seiffert 61eee9e0a2 Pass on Android toolchain flags for CXX runtime check. 7 years ago
David Chisnall 8560a65f21 Add a missing `extern "C"` to slot.h.
Fixes #117
7 years ago
David Chisnall e6e86d309b
Merge pull request #116 from jordo/cpp-compile-fix
_Bool fix for cpp compilation
7 years ago
Jordan Schidlowsky 6e3c618b82 cleanup in blocks runtime for closer consistency with apple 7 years ago
David Chisnall 414e0baa0e Add Control Flow Guard checks on Windows. 7 years ago
Frederik Seiffert 5308d21c1e Use const pointers for associated object keys.
Matches Apple platform implementations.
7 years ago
Jordan Schidlowsky a1a3b7a4db cleanup cpp and c defines 7 years ago
Jordan Schidlowsky 72b1f9d1fa _Bool fix for cpp compilation 7 years ago
Frederik Seiffert d16faeded9 Fixed warning in imp_implementationWithBlock.
This was caused by switching the method signature to use "id" for the block parameter.
7 years ago
David Chisnall 375018a933 Fix upgrading legacy properties with qualifiers.
This fixes PropertyIntrospectionTest2_arc with the 1.x ABI and enables
the test that was disabled in this mode.
7 years ago
Frederik Seiffert 5aa82d059a Disabled atomic property tests on legacy ABI versions. 7 years ago
Frederik Seiffert 09fdceaa7d Fixed property_copyAttributeList skipping logic
Was incrementing the index twice and thereby possibly skipping over the string end with undefined results.
7 years ago
Frederik Seiffert fb32780698 Extended property introspection test with atomic-type property. 7 years ago
Frederik Seiffert 5917514ac1 Added test for atomic ivars. 7 years ago
Frederik Seiffert ae6a777742 Add support for atomic type qualifiers.
Fixes #101.
7 years ago
Frederik Seiffert a2463192d0 Use `id` as type for block runtime functions.
Fixes #103.
7 years ago
David Chisnall 1ab65ca818 Replace incorrect magic number with sensible number. 7 years ago
David Chisnall 945bbd760d Mark some tests as big.
Setting these tests to use 3 processors is weird, but it means that in
CI (where we do 4 tests in parallel), we won't ever run more than one of
these at a time (though we can run any other one test at the same time
as these).  This should fix the intermittent failure.
7 years ago
David Chisnall c4cb965033 Add more assertions to ManyManySelectors test.
This is intermittently failing in CI.  It looks as if the CI machine is
running out of memory in a way that we are not gracefully handling.
7 years ago
David Chisnall e5eaeae9ac Update ANNOUNCE. 7 years ago
David Chisnall 9d790b4118 Fix long vs size_t error on Windows.
On win64, long is 32 bits, not 64 bits as it is everywhere else.
7 years ago
David Chisnall d4438095ed Add note to ANNOUNCE about WinObjC. 7 years ago
David Chisnall ed1de9e9f6 Explain the badges. 7 years ago
David Chisnall 54f7840d92 Add badge for FreeBSD CI. 7 years ago
David Chisnall 893417c7c9 Bump clang to 8.0 - some tests fail with 6. 7 years ago
David Chisnall 405b745a17 Initial attempt at FreeBSD CI. 7 years ago
David Chisnall f0d7fd4165 Optimise some ARC functions a little bit.
The calls to objc_storeWeak were not being inlined, so we were not
benefiting from optimisations based on the invariants.
7 years ago
David Chisnall 722a2c3b0d Fix some weak pointer bugs.
These most likely led to some intermittent failures in weak references.
The `objc_moveWeak` and `objc_copyWeak` functions were assuming that the
target may contain valid data, but the spec for these says that it may
be uninitialised data.  We were reading uninitialised data and then
seeing if it happened to be a valid object.  Most of the time it was
likely to be nil, so this wasn't an easily reproduceable problem...

I believe this is the correct fix for PR #95.

Fixes #95
7 years ago
David Chisnall 369c84db35 Fix compiler warnings. 7 years ago
David Chisnall 50493c38d7 Don't use pthread storage for exceptions.
If an exception unwinds to the top of a thread, the process will die, so
don't worry about leaking memory for this case.
7 years ago
David Chisnall 00ce6fe46f Make CI work with 32-bit and 64-bit Windows 7 years ago
David Chisnall 2b9b868cf7 Remove inline from isSelRegistered.
It seems to not be exported in the Windows release configuration.
7 years ago
David Chisnall 318ae27d8b Allow attempting to load a module twice.
This is necessary because FreeBSD/ARM and possibly other platforms use
.init_array and not .ctors, so never call the init functions.  As a
result, we will need the compiler to move to putting the load function
in .init_array and may end up with it being called by both variants.
7 years ago
Li Keqing 6eb1e51a49 _CYGWIN is not defined internally in cygwin but __CYGWIN__ 7 years ago