11 Commits (71e38a048fc06fea0c2015662540d46a33b5c45d)

Author SHA1 Message Date
David Chisnall e23882fb23 Rewrite the selector table in C++.
This replaces a few home-grown datastructures with third-party ones that
get a lot more testing:

 - The home-grown hopscotch hash table is moved to using robin map.  The
   original was designed to be lock free, but we've been using it behind
   a lock for ages.
 - The selector list is now a std::vector.
 - The types list now use std::forward_list.

This also removes a couple of code paths that haven't been used since we
started using the new ABI data structures internally and upgrading at
load time.

The new code tries to differentiate in the static type system between
registered and unregistered selectors.  The check for whether a selector
is registered is fragile and depends on no selector being mapped or
allocated in memory below the total number of selectors.  This check can
now disappear on most code paths.

On a single test machine (not guaranteed to be representative) the test
suite now completes around 20% faster.
3 years ago
David Chisnall 9718ce247d Initial start of documenting the ABI. 8 years ago
theraven 12385fcb1e Tidy up low memory profile to use slots directly. 15 years ago
theraven 24de067017 Default to building without the legacy APIs, now GNUstep doesn't require them. 15 years ago
theraven e198597bd3 Added support for associative references. Modified sync code to use this. 15 years ago
theraven 62536ce247 Added more header comments. 15 years ago
theraven a2db6f58be Made the selector name field into a union of the name (unregistered selectors) and the selector id / index (registered selectors), to more accurately reflect how it is used in the code. 15 years ago
theraven 42a545fc7c In some irritating circumstances, the load order can cause a +load message to trigger other code, which sends messages with selectors that have not been mapped yet.
The runtime was handling the message lookup correctly in this case, but only as a side-effect of the fallback code from when type-dependent dispatch is not possible.  This resulted in a confusing warning message, telling you that you were calling a method with an incorrect signature, when the two signatures that it printed were the same.

This case is now handled correctly, so the warning disappears (unless you really are calling a method with the wrong signature and have TDD enabled).
16 years ago
theraven 0e374db1db Added support for type-dependent dispatch to libobjc2. 16 years ago
theraven b1b9baf382 Finished rewrite of message sending. Deleted lots of legacy stuff. 16 years ago
theraven 2d84b96a72 Tidied up some bits by creating private headers for private data structures.
Imported selector table code frm the Étoilé runtime.  We can now make dispatch type dependent with a -D switch.  Not enabled yet, but it will be enabled in a warning mode soon - I consider preferable to the existing GNU and Apple solution of corrupting the stack.
16 years ago