239 Commits (025688a2d5442c3c2db604e51c7018ec8e9b6e45)
 

Author SHA1 Message Date
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 0957cbe425 Factored out dtable stuff into dtable_legacy.c so that it can be replaced and so that we can do some profiling of the replacement to make sure it doesn't introduce performance regressions. 16 years ago
theraven 0045ce0cbd Install slot.h. 16 years ago
theraven 96de597b3c Mark string functions unused, in case the header is included in files that only use one of them. 16 years ago
theraven 7b8b3839df More refactoring. 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
theraven a6b5cd15dc Rename the library with the lib prefix so it can actually be linked sensibly. 16 years ago
qmathe 7656e1f9aa Commented out 'firstslot' unused variable, otherwise Clang reports it as an error. 16 years ago
theraven 96f51da81e Commented out some premature termination code. This is a bit of a hack; we're now repeatedly adding the same methods to dtables, which is ugly. We ought instead to be able to test if something is a lazy copy. 16 years ago
theraven 23447feca5 Profile-driven inlining of Objective-C methods. 16 years ago
theraven ede942cdd8 Simplified profiling even more. Now should allow inlining of manually-cached IMPs. 16 years ago
theraven 9ea9a6cf41 Made inlining conditional on inlining actually being sensible. 16 years ago
theraven 6a58d3d49d Added unfinished inliner that uses type feedback info to inline instance methods.
Made class method inliner also inline message sends to super.

Various updates caused by clang now attaching more sensible metadata to the IR.
16 years ago
theraven 160d1ce829 Added cachable version of the message-to-super lookup function. Clang now calls this in preference to the other one when -fobjc-nonfragile-abi is specified. 16 years ago
theraven 168a0d02e1 Revert last commit. Was fixing the wrong thing. 16 years ago
theraven 3f52e353ee Mark NSBlocks classes as resolved, so we don't crash trying to interpret the class pointers as strings... 16 years ago
theraven c425b1bfdc Initial (working) type feedback pass. Records the IMP for every message lookup. Note: This writes 3 words for every single message send, which means that it makes code VERY slow and can fill up the filesystem if you leave it enabled.
The aim of this pass is to identify message send sites which can benefit from speculative inlining and inline caching.  By itself, this pass is useless.  It will later be combined with one that parses this information and then uses the existing caching and inlining infrastructure to optimize hot message send sites.

Now, however, it's time for me to go and dance, so the useful bit will have to wait.
16 years ago
theraven 6459292a40 Simplified profiling system and enabled it by default. This should be safe, because it no longer depends on dladdr() and friends (which don't work reliably anywhere), and instead expects the profiling modules to register their own symbol table. 16 years ago
theraven 6cac2816cc Added speculative inlining of class messages. Currently inlines all that it can, without deciding whether it's sensible. 16 years ago
theraven beb8356367 Made ClassIMPCache a ModulePass (it shouldn't be a FunctionPass because it adds globals). 16 years ago
theraven 60f87bc4ad Removed debugging code that shouldn't have been in last commit.
Aside: Testing the two passes from the last commit shows that they provide about a factor of 10 speedup for class messages.
16 years ago
theraven 84b41a8464 Added -gnu-class-lookup-cache and -gnu-class-imp-cache passes. These add caching for class messages and also skip the class lookup (using the class symbol directly) where possible.
In combination, these make class messages marginally slower than function calls, rather than significantly slower than message sends.
16 years ago
theraven 352dfe2d93 Removed some unneeded #includes. 16 years ago
theraven 874ec4bd66 Fixed IMP cacher to not cache the slot if the lookup function changes the receiver (this could result in a method being called on the wrong receiver, which would just be confusing). 16 years ago
theraven dfc4a0286b Factored out code that performs IMP caching into a separate class. This can now be used by other passes that cache IMPs outside of loops (for example, always caching class messages because they always have the same receiver). 16 years ago
theraven 1918888ce1 Added LoopIMPCachePass. This pass automatically performs IMP caching on all loops.
Microbenchmark that just sends a message that does nothing 1000000000 times in a loop goes from taking 10.2 seconds to taking 4.7 after running the pass.
16 years ago
theraven 289d412dac Fixed lookup of superclass when superclass is nil. 16 years ago
theraven ce5b0e9f83 Added out-of-tree GCKit stuff. Still (very) work-in-progress. 16 years ago
rfm 7b535dcda4 Revert change ... leave objc_skip_offset() buggy for code which depends on that behavior. It's better just to avoid using it anywhere else. 16 years ago
rfm c8412c806d Fix objc_skip_offset() to avoid skipping and extra character 16 years ago
theraven 09ed66f819 Fixed use of uninitialized variable. 16 years ago
theraven d9ead92cb3 Fixed bug in allocating metaclasses for lock classes. 16 years ago
theraven 352e721861 Changed ptrdiff_t to int in property accessors. This is for compatibility with some changes in clang that are required to prevent things from breaking on LP64 platforms.
It would be cleaner to use a ptrdiff_t here, but unfortunately we can't because the ivar_offset field in the runtime metadata is an int so ivar offsets beyond 4GB will not work on LP64 platforms.

This probably isn't a limitation.  If you have more than 4GB of ivars in one object, you've done something badly wrong and probably shouldn't be allowed to write code anymore.
16 years ago
theraven e85975a36e Don't make NSObject a subclass of NSObject. Thanks to Truls Becken! 16 years ago
theraven 023184f4b5 Removed unused static function. 16 years ago
theraven 93251416eb Added LLVM optimisation passes for libobjc2. 16 years ago
theraven fb26e9a9ef Disable sender-aware dispatch - it breaks some code. 16 years ago
theraven ff7af18060 Correctly handle getting the name of nil. For some given value of correct, where 'correct' means 'compatible with the Apple behaviour' and not 'actually sensible'. 16 years ago
theraven a35ece500f Rewrote objc_getClassList() to use class table directly.
Fixed missing UNLOCK() from last commit.
16 years ago
theraven 0abdc2a574 Small cleanups from last commit. 16 years ago
theraven 8ce32fd1c9 Rewrote class resolving code. Now it only resolves classes that actually need resolving, rather than iterating over the entire class table.
(This is part 1.  Part 2 will lazily resolve classes.)
16 years ago
theraven bfbd52709b Fixed off-by-one error in hash table enumerator, which was causing one class to fail to be resolved. 16 years ago
theraven 492b2315c1 Rewrote property locking to be faster and not require @synchronized (which breaks if you call it in the object's -dealloc method). 16 years ago
theraven 71be4a20f3 Made magic object header use #define instead of const (gets rid of unused variable warnings). 16 years ago
rfm 5eb97d0e38 fix missing line 16 years ago
rfm 76845ff81c fix wrong commit 16 years ago
rfm b7963e23a6 backport class data copying fixes from ObjectiveC2 16 years ago
rfm bc0ad88a82 complete backport 16 years ago
rfm e2f4f38e45 backport bugfixes from ObjectiveC2 code 16 years ago
rfm bf92e25952 match ivar lookup with osx and compatibility library 16 years ago