1132 Commits (fa35aaf5eed4b71821fea2888da8061d4920a56c)
 

Author SHA1 Message Date
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
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 65b34a196f Add support for improved property structure.
As a side effect, we need to upgrade properties in class and protocols
(but not categories because we didn't have class properties in earlier
ABIs).
8 years ago
David Chisnall b7ef58bc59 Look up the class name when registering an alias.
In the v1 ABI, this function is called with the class symbol directly,
so we need to make sure that we replace it with the upgraded symbol.
8 years ago
David Chisnall 45d0b8e4c9 Add support for registering aliases.
Also add a test.
8 years ago
David Chisnall 93b3f889a6 Update documentation. 8 years ago
David Chisnall a8752cd842 Clean up method / slot lookup interfaces. 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 314a4167ca Remove low memory profile.
This hasn't been tested for a long time and probably doesn't work.
8 years ago
David Chisnall 0964d63ba9 Update for the compiler / linker setting up superclass pointers.
In the legact ABI, superclass pointers are initially set to strings
containing the superclass name and the runtime fixes them up.  In the
new ABI, the compiler sets up the linkage directly.
8 years ago
David Chisnall f3386c530e Add asserts that we don't see extended type encodings in selectors.
It might be a good idea to handle user-provided extended type encodings,
but for now we just abort.
8 years ago
David Chisnall ccb8627765 Don't leak extended type encodings in slot access. 8 years ago
David Chisnall 6c1fc86f01 Clean up a condition.
Skip adding the null capability.
8 years ago
David Chisnall 5a9c65553f Always use selector type for method type encodings.
In the new ABI, we use the legacy type encoding in the selector and the
extended type encoding in the types field.  We want to only expose the
legacy type encoding through existing APIs.
8 years ago
David Chisnall 4f71429bec Add support for parsing extended type encodings.
Extended type encodings add more detailed information to object and
block types:

* Objects are encoded as @"ClassName".
* Blocks are encoded as @?<parameter type signature>

In the new ABI, we use classic type encodings for selectors and extended
type encodings everywhere else.
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 44a85a401a Add size to the property list.
It should now be possible to support newer ABIs.
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
David Chisnall 12a0d97849 Add protocol references in the loader.
These are currently ignored, because they are only important when the
runtime has upgraded the protocol.  The runtime will upgrade legacy
protocols, but they are not referenced by this indirection layer.
8 years ago
David Chisnall 8789016b21 Improve a comment. 8 years ago
David Chisnall 959fabbfec Fix typo. 8 years ago
davidchisnall bdf7299af9
Merge pull request #62 from Microsoft/cherry-pick-acd3fcc
fix objc_msgSend.x86-32.S for win32
8 years ago
davidchisnall b8badbb28e
Merge pull request #63 from Microsoft/assocloss
always look beyond the first page of associated objects
8 years ago
davidchisnall b1494c8823
Merge pull request #59 from Microsoft/cherry-pick-7a226d8
win32: use native threading APIs instead of pthreads
8 years ago
davidchisnall c5b96fafe9
Merge pull request #56 from Microsoft/cherry-pick-aa58f6f
teach class_setSuperclass about metaclasses, subclass lists, and dtables
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 d66d6e5a14 Fix a warning in runtime.c 8 years ago
Dustin Howett 072972600a fix objc_msgSend.x86-32.S for win32 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 82d4d3fbfd merge dtables inplace, don't hold rt lock while initializing 8 years ago
Dustin Howett 9459f53ffa Add a class inheritance helper 8 years ago
Dustin Howett 6af4fcb219 Fix eh_personality for NO_PTHREADS 8 years ago
Dustin L. Howett 430ab75014 win32: use native threading APIs instead of pthreads
* use fiber local storage if NO_PTHREADS is defined
* use critical sections instead of mutexes

Contributing-author: Ben Viglietta <benvi@microsoft.com>
8 years ago
davidchisnall ebed8468a1
Merge pull request #61 from Microsoft/assoc_test
Add a test for e3b069c (association policy)
8 years ago
Dustin Howett 81f7b16af5 Add a test for e3b069c (association policy) 8 years ago
David Chisnall 3c036b3f4f Use nullptr for nil in C++11. 8 years ago
David Chisnall 7539d7e042 Fix warnings in test. 8 years ago
davidchisnall bfa19f152f
Merge pull request #60 from Microsoft/hash-test
Add a hash table deletion test to validate a0eec52
8 years ago
Dustin Howett 45f6572379 Add a test for a0eec52 8 years ago
davidchisnall b9d5523cc2
Merge pull request #53 from Microsoft/cherry-pick-038543f
fix a mismanagement of the hash table that could lead to data loss
8 years ago