1121 Commits (e627c14b5f935b36ff847c0d6eaca55534df9417)
 

Author SHA1 Message Date
Niels Grewe e627c14b5f fix(libBlocksRuntime compatibility): Install proper compatibiltiy headers for libBlocksRuntime 7 years ago
David Chisnall abf629b1f7 Make some private symbols private. 7 years ago
David Chisnall cace3a4062 Add some more debug logging. 7 years ago
David Chisnall c489cc909d Fix header symlink installation. 7 years ago
David Chisnall e811e6ce32 Fix build failure in test. 7 years ago
David Chisnall 93248d581b Allow double indirection for superclass pointers. 7 years ago
David Chisnall 455a4758f1 Make CMake install the dll on Windows. 7 years ago
David Chisnall f4be4d5696 Disable old ABI compat by default on Windows. 7 years ago
David Chisnall 0da21d5064 Add some more Windows build tweaks.
This enables building on Windows with Ninja.
7 years ago
David Chisnall d0c3fe5323 Remove a broken assertion.
This was checking that a variable that was never assigned to was a
non-zero value.
7 years ago
David Chisnall 262cea96f5 Fix test for clang 8.
Clang 8 now rejects the thing that this is testing (which is good,
because it's a terrible idea).
7 years ago
David Chisnall c99476cc7d
Merge pull request #75 from ePirat/fix-missing-header
Add missing header file to CMakeLists
8 years ago
Marvin Scholz c498a65fe6 Add missing header file to CMakeLists 8 years ago
David Chisnall 782b1ec3b3 Update some docs. 8 years ago
David Chisnall f0884dda76 Add some release notes. 8 years ago
David Chisnall 6c2a61de9b Improve protocol reference loading.
Now all @protocol references will refer to precisely the same instance,
even across shared libraries.
8 years ago
David Chisnall bc726e7564 Improve protocol table locking.
Remove the protocol table from the global lock and make sure that we do
acquire it when accessing the table.
8 years ago
David Chisnall b9b6198520 Improve the forward-declared protocol test. 8 years ago
David Chisnall 6ab3df0892 Improve the forward declare protocols test.
Make it not fail to build with older compilers and make it test the
thing that should be true with the new ABI.
8 years ago
David Chisnall f7a21aaf4d Bump the CPack version to 2.0. 8 years ago
David Chisnall 2978cbb760 Don't try to symlink headers on Windows 8 years ago
David Chisnall a8e5f6ced0 Fix another bug in the hash table.
Clearing the secondMaps was incorrect for cases where the secondMaps
included a wrap around to the start of the table.
8 years ago
David Chisnall 00c631c58e Fix a bug in a test. 8 years ago
David Chisnall a9acb9c5b6 Add missing file. 8 years ago
David Chisnall 1bc7ac26f8 Improve block-to-IMP code on Windows.
This version will work with Windows Store apps.

Patch by Dustin Howett!
8 years ago
David Chisnall e67d09648d The stuff that said 'DO NOT COMMIT THIS'?
It turns out, I didn't mean to commit it!  Dead code that was just there
to simplify compiler bringup.
8 years ago
David Chisnall 65d5adc9f7 Add some extra test cases to the exception test.
We were testing this in the ObjC++ interop test, but it makes sense to
run the test even when not building ObjC++.
8 years ago
David Chisnall 537c409722 Tweak objc_msgSend to work correctly on win32. 8 years ago
David Chisnall 8e825a8416 Make Win32 block trampolines SEH compatible.
This change is effectively a no-op (it's impossible to throw an
exception through these trampolines, because they tail call the real
block), but it does prevent the linker from complaining that we're
linking SEH-aware and SEH-unaware code.
8 years ago
David Chisnall 1d164676a5 Rework ivar offset calculation again.
It's now simpler, and the tests pass on several different targets, so
it's probably even correct!
8 years ago
David Chisnall ed2ccda8bb Use _aligned_malloc on Windows.
On 32-bit Windows, malloc doesn't give us memory with sufficiently
strong alignment for AVX vectors.

Note that Windows also has a family of allocators that provide guarantee
exact misalignment.  Using these would simplify the ivar layout logic
slightly, because we wouldn't need to account for the refcount pointer.
It's not clear that it's actually worth doing though, because that logic
already exists.
8 years ago
David Chisnall 6e52cbbbe8 Make SEH exception handling work on 32- and 64-bit Windows.
Also change the expected mangling to reflect in-progress Clang changes.
8 years ago
David Chisnall d4278a009c Fix an integer underflow bug.
We weren't correctly sign-extending the value being compared, which was
resulting in objects not being deallocated.  For some reason, this only
appeared on Windows, even though the code looked wrong on all platforms.
8 years ago
David Chisnall 3fc3e11296 Fix building the runtime test on Windows. 8 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
Dustin L. Howett f352f62423 Add a MSVC/VS2017-compatible objc_exception_{,re}throw
This implementation of objc_exception_throw constructs a
_CxxThrowException-compatible ThrowInfo based on the runtime type of the
passed-in exception. Everything pertaining to the exception is allocated
on the stack before the call and destroyed when/if the stack frame is
aborted.

The construction of ThrowInfo, CatchableTypes, and TypeDescriptors, as
well as mangling, is compatible with Clang/LLVM's MicrosoftCXXABI
exception generator.

This ties Objective-C exceptions on Windows to the C++ exception model,
which allows us to support (unboxed) foreign exceptions and C++ catch of
Objective-C types.

objc_exception_rethrow recycles MicrosoftCXXABI's rethrow.

Contributing-author: Jordan Saunders <jmsaunde@microsoft.com>
Contributing-author: Shayne Hiet-Block <shaynehi@microsoft.com>
8 years ago
David Chisnall 38efd04e33 Fix some bugs in protocol upgrading from old ABIs.
Reported by Riccardo Mottola!
8 years ago
David Chisnall 43f557e26e Add the size field to the ivar structure.
This was the last change made to the ABI before upstreaming the clang
parts.
8 years ago
David Chisnall 22abbd2ca2 Fix a bug in hidden class deletion.
We were leaving the isa pointer pointing to the deleted class and were
then following its super_class pointer, both of which are potentially
serious.  This didn't show up on FreeBSD, because the relevant memory
was always returned to a thread-local pool and the accesses were
immediately afterwards, so it always worked.  It broke with malloc
implementations that were more aggressive about checking for
use-after-free.
8 years ago
David Chisnall 0ae4e4ceb7 Remove the need to include C++ <exception>
We were only doing it to get two definitions, which are both mandated by
the spec, so we may as well avoid all of the headaches involved.

Also remove the extern "C" from the runtime.h include while we're here,
as it is no longer needed.

Fixes #69
8 years ago
David Chisnall 4e9fd2ec8a Rename objc_slot and objc_slot_v1.
The objc_slot type was exposed via public interfaces and the renaming
broke things (including the GNUstep build).
8 years ago
David Chisnall f569aeb42b Add 1.9 release announcement to 2.x series. 8 years ago
David Chisnall f48403d51c Add commented code for iterating over constant strings. 8 years ago
David Chisnall c5cc4b9742 Update 2.0 release announcement. 8 years ago
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