29 Commits (79b67ad04445d60c4700296b51a55e357cf620a5)

Author SHA1 Message Date
theraven 12385fcb1e Tidy up low memory profile to use slots directly. 15 years ago
theraven f0974cb415 Cosmetic fix - use the correct union field, not an explicit cast. 15 years ago
theraven f5f0816777 Make the selector hash depend on the types as well as the name - should reduce
hash collisions between typed and untyped versions.
15 years ago
theraven 24de067017 Default to building without the legacy APIs, now GNUstep doesn't require them. 15 years ago
theraven d51500184c More cleanups. Stop using __ identifiers for internal stuff now that it's properly marked private and we don't have to worry about conflicts. 15 years ago
theraven 6c7cf4a5a6 Add visibility attributes on all internal functions so that we aren't ever exporting them outside of libobjc. 15 years ago
theraven 5a75ca53ff Eliminate some redundant copying. 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
ericwa d56930241e Stylistic fixes 16 years ago
ericwa ed1c9d41eb libobjc2: Add a pile of NULL checks. In general, any public function should be able to handle NULL for any object/class/selector/pointer to opaque structure without blowing up. 16 years ago
theraven ede0756942 Version of r31403 that actually works. 16 years ago
theraven aea0cc7c4e Work around idiocy with type encodings. 16 years ago
theraven acb125fbb8 Fix sel_isEqual() when passed a NULL selector. 16 years ago
theraven 9c077368a8 Make sel_copyTypes_np() return the number of types in all cases. 16 years ago
theraven 60e0fa9f95 Ensure that sel_getName() on two selectors with the same name always returns the same string. 16 years ago
ericwa dbb8ea2090 add deprecated sel_eq function for compatibility 16 years ago
ericwa 8f857ae5d3 libobjc2: Change sel_getUid to just call sel_registerName (compatible with OS X 10.0 onwards) 16 years ago
theraven fe566cbc2f Fix introspection with type-dependent dispatch enabled. Looking up a method with an untyped selector was failing because the UID for the selector was no longer the same for all type variants.
As a side-effect of this change, method lookups for introspection are now much faster.  They use the slot lookup mechanism to find which class has the method declared and then only need to do the linear search on that class, rather than doing the linear search on the entire hierarchy (slow!).  If the method is not present, then they can give up after two memory accesses, rather than after searching a few hundred list entries, but that's a less important case.

I also noticed while tracking down this bug that the implementation of methodSignatureForSelector in GNUstep is very inefficient.  I'll tweak that next.
16 years ago
theraven 0284155f2d Added a hook that defines the behaviour when you call a method with the wrong signature. 16 years ago
theraven 06015757a7 Type dependent dispatch now actually works. 16 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
thebeing 11b7b2b23c Fix compilation issues. 16 years ago
theraven 0e374db1db Added support for type-dependent dispatch to libobjc2. 16 years ago
theraven bb8cafaa15 Finished rewriting the loader. It's now cleanly separated into logically-separate components, so there's a chance it might actually be maintainable... 16 years ago
theraven fdc1f1e916 Removed more unused code. 16 years ago
theraven c40f9e84f2 Return NULL instead of "" from sel_getTypes_np() - matches behaviour of sel_get_types() and makes more sense. 16 years ago
theraven 060ddf89be Another 64-bit fix. 16 years ago
theraven b04cccf46b Fixed some issues in runtime.c when looking up methods. This fixes some issues with DO.
Removed GNU dtable and sparse array implementations, replaced entirely now with versions based on the Étoilé runtime.  Performance is roughly equivalent in microbenchmarks, memory usage is significantly lower (Gorm goes from 95MB to 50MB on my machine - this will be even more pronounced on 64-bit systems), which should improve cache usage considerably.  Still room for some performance tuning, however.
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