13 Commits (893417c7c982623537e300cda2a94db5beaa25ec)

Author SHA1 Message Date
David Chisnall f06508bfd9 Fix typo in comment. 10 years ago
David Chisnall 5107130277 Move the data for sparse arrays into the tree structure.
This saves one load on the message send path for each tree depth (2
loads in the common case, 3 if you have a lot of selectors), which
should improve cache usage considerably.

Note: This is a checkpoint commit.  Currently, every objc_msgSend()
implementation except for x86-64 is broken.
10 years ago
theraven 9e93a413d1 Print some memory usage statistics on exit if LIBOBJC_MEMORY_PROFILE is
defined.
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 ad16172625 First pass at implementing Apple-compatible GC using Boehm. Still needs some tidying, but the following work:
- __strong pointers, preventing objects from being freed

_ __weak pointers are automatically freed when the last remaining __strong pointer goes away

- objc_gc_{retain,release}_np() functions, which can be used to implement CFRetain() and CFRelease() (adds an reference count - the object will not be collected until after its last retain is gone.
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 b1b9baf382 Finished rewrite of message sending. Deleted lots of legacy stuff. 16 years ago
theraven 1a60fabf96 More 64-bit fixes. 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 4be9799259 Unrolled the SparseArrayLookup loop. This means we only need one jump, instead of 2, which gives the same performance as the old GNU code and about half the memory usage. It's really, really, ugly code though - I need to teach the compiler to do this optimisation so I don't have to. 16 years ago
theraven 0d78186238 Some bug fixes and tidies.
I now have an out-of-tree replacement for the dtable stuff, so sarray.{h,c} will be going away soon.  The replacement offers similar (slightly worse currently) performance in microbenchmarks, but uses half as much memory (Gorm goes from 95MB to 48MB on my machine).  This will be committed once it's been tweaked a little bit.
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