62 Commits (a2463192d0fd68940a276bb1108964f46be9d51e)

Author SHA1 Message Date
Frederik Seiffert a2463192d0 Use `id` as type for block runtime functions.
Fixes #103.
7 years ago
David Chisnall d015f0160c Rename PUBLIC to OBJC_PUBLIC to avoid some namespace pollution. 7 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 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 0c9ee8b920 Improve protocol tests and fix bugs.
Also add the new protocol_getProperties2 function.
8 years ago
David Chisnall b81df02b91 Merge branch 'master' into newabi
Simplify the setSubclass dtable updating mechanism.
8 years ago
David Chisnall 040114dff1 Remove some obsolete documentation. 8 years ago
David Chisnall 4891eb9d5f Document a bit more of class structure and of type encodings. 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 a8752cd842 Clean up method / slot lookup interfaces. 8 years ago
David Chisnall 3c036b3f4f Use nullptr for nil in C++11. 8 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
theraven c73b7a2f0b Mark all libobjc2 headers as system headers when not compiling the runtime
itself.  This makes clang hide warnings.
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 6317b79a10 Implemented the new exception ABI, and a load of tests for it. This is used by
clang trunk if -fobjc-runtime-1.7 is specified and provides significantly
better interoperability with foreign exceptions.

Note: Most of the exception tests will not pass with gcc or clang < 3.3.  They
test things that are impossible to implement quite correctly with the
GCC-compatible exception ABI.

Also updated the release notes to reflect recent improvements.
13 years ago
theraven f9f2e4e313 Added a function for getting the type encoding for a block returned by imp_implementationFromBlock(). 14 years ago
theraven 4796a41e4e Finished implementing the new runtime APIs. 14 years ago
theraven 43ee8b9819 Add initial support for imp_implementationWithBlock() and friends. Currently
only works on x86 and x86-64 and doesn't work with sret functions.
14 years ago
theraven f133fa7eb8 Better ObjC++ support in runtime.h 15 years ago
theraven 1d16930450 Fix missing semicolon.
Make Makefile.clang work

Patch by Charlie Sharpsteen.
15 years ago
theraven 5d3c047fa2 Finished implementing JavaScript-style prototypes. 15 years ago
theraven b54719abf1 Basic support for prototype-style object orientation (you can now add methods to an individual object). 15 years ago
theraven 908374672d Make OBJC_SMALL_OBJECT_SHIFT / OBJC_SMALL_OBJECT_MASK constants. 15 years ago
theraven 8e34dccda9 Deprecate access to the isa pointer. This will become a hard error in future. 15 years ago
theraven 22e5aaf7b0 Add OBJC_SMALL_OBJECT_SHIFT macro. 15 years ago
theraven 8af52846b7 Small object (hidden in a pointer) support. 15 years ago
theraven 893b9bf958 Add guard if __has_feature is not defined. 15 years ago
theraven 9b70b22eee Use __unsafe_unretained instead of const for returning protocol arrays. Let's not break everyone's code, even if we really want to. 15 years ago
theraven b5380d50d3 Added support for ARC.
Weak references are still not supported, but code that doesn't use them (i.e. any code that wants to be compatible with OS X 10.6) will work fine.

The current implementation is VERY inefficient and has a large number of missed optimisation opportunities: this is the 'make it right' phase, and should be almost equivalent to explicit retain / release code.
15 years ago
theraven 8ee4d9c38a Added implementation of property_getAttributes(). This is a horrible interface, both to implement and to use. We should add some better interfaces. 15 years ago
theraven c6f0651609 Implemented objc_copyProtocolList(). 15 years ago
theraven 79b67ad044 Added missing ivar access functions. 15 years ago
theraven e198597bd3 Added support for associative references. Modified sync code to use this. 15 years ago
thebeing ee7817cf57 Implement a hook that allows the compiler to register the aliases used with the
@compatibility_alias directive so that they can be resolved at runtime.
15 years ago
theraven faa741b133 Added some header documentation for runtime functions. 15 years ago
theraven 7336df75bc Added some more comments, C++ include guards around runtime.h. 15 years ago
theraven 73e1e2934b It turns out that Apple chose some confusing and non-intuitive semantics for
catching Objective-C objects in C++ catch statements (i.e. they follow
Objective-C semantics, not C++ semantics, irrespective of whether you use C++
or ObjC syntax).  We now default to Apple-compatible behaviour, but provide a
function that allows users to select the sane semantics if they prefer.

Added a capability bit for the unified exception model, so code can require it.
This is not really required, since any code using it will link against the
ObjC++ personality function and will get a linker failure if it isn't supported.

Also enabled Objective-C++ stuff by default.  This adds a dependency on the C++
standard library (actually on libsupc++, but GNUstep Make wants to link against
libstd++ anyway), which is not ideal.  It can be disabled with:

$ gmake objectiver-cxx=no

I suggest that this is only done by people who know that they will never want
Objective-C++ support.
15 years ago
theraven e0d80861b5 Added some documentation. 15 years ago
theraven bde6bf0e14 Fix truncated comment in header and 'worse than useless' macro.
Both issues pointed out by Jens Ayton.
15 years ago
ericwa a7ea477400 libobjc2: put libobjc compatibility functions in runtime.h marked __attribute__((deprecated)) 15 years ago
theraven 7be9f34619 Fixed @synchronize() with a class that has had an instance used for @synchronize(). 15 years ago
theraven 025688a2d5 Added property_getName(). Added non-portable API documentation. 16 years ago
theraven d70523947b Implement some missing runtime functions. 16 years ago
theraven 9c077368a8 Make sel_copyTypes_np() return the number of types in all cases. 16 years ago
theraven a029fb2af3 Expose sel_copyTypes_np(). 16 years ago
ericwa c604289023 libobjc2: define SEL as const for GCC 16 years ago
theraven 0177ef56e1 Tweak the type encoding stuff a bit. 16 years ago
theraven 5885fd196a Add defines for ObjC types (GNUstep apparently uses them, even though they are not part of the language spec, but the things that they define are, so they only serve to obfuscate code where they are used). 16 years ago
theraven bd58a33b84 Prevent accidental mixing of GNU runtime headers with GNUstep runtime.h. 16 years ago
theraven 77d02d075b Add some missing protocol introspection functions. 16 years ago