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
rfm
607bc433c9
Fix instance variable lookup to match OSX
16 years ago
theraven
719b540317
Set resolve / initialize flags for new metaclasses.
16 years ago
theraven
01559280f3
Fixed LOCK() -> UNLOCK().
...
Thanks to TOM!
16 years ago
theraven
ae11414b4d
Handle case where @synchronized is used with a class.
16 years ago
rfm
196ce9abb1
Cope with null selector/selecotr name as in OSX
16 years ago
rfm
301c01b2ae
slightly more rigorous dtable handling.
16 years ago
theraven
eee7956bce
Cleaner version of the last fix.
16 years ago
theraven
d4fe4f522e
Fixed typo in comment in runtime.c.
...
Fixed unsafe dtable access in message lookup.
16 years ago
theraven
d770ed9688
Correct version of last fix...
16 years ago
theraven
de4b63e41d
Fix for root class using non-fragile ABI.
16 years ago
rfm
d89b28c40c
check for nil superclass before dereferencing
16 years ago