37 Commits

Author SHA1 Message Date
theraven
6412c7a4e7 And another one... 2011-06-24 14:36:54 +00:00
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.
2011-05-22 23:02:04 +00:00
theraven
535ba87a8e Store the selector, not the type encoding, in slots. 2011-04-22 12:13:28 +00:00
theraven
d7056f6de2 Simplify @synchronize() and improve efficiency (space and time). 2011-04-17 18:04:58 +00:00
theraven
987ab88a94 Don't do hidden-class transforms for classes, just dangle the look-aside data off the class structure.
Individually lock classes so that +initialize can be sent concurrently to two different classes in two different threads.
2011-04-17 17:31:37 +00:00
theraven
24de067017 Default to building without the legacy APIs, now GNUstep doesn't require them. 2011-04-15 12:08:49 +00:00
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. 2011-04-14 16:44:34 +00:00
theraven
23b26820f5 Make it easier to suppress mismatched selector warnings. It's useful for the runtime to tell you when your code is bad. Not so useful for it to tell you when someone else's code is bad... 2011-04-06 18:17:18 +00:00
theraven
f330ba0f36 Remove thread-local variable that isn't actually used... 2011-03-26 13:36:25 +00:00
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. 2011-03-15 17:27:26 +00:00
theraven
2e3b19b735 Ugh, made the same mistake I spent an entire lecture telling my students not to make. Feeling stupid. 2011-02-20 19:12:39 +00:00
theraven
4a3326f2fd Fix class_getMethodImplementation() semantics for Apple compatibility (returns forwarding selector IMP, doesn't actually do the forwarding). 2011-02-20 00:00:12 +00:00
theraven
8c966c461b Return the forwarding IMP from get_imp if required. 2011-02-12 18:19:19 +00:00
theraven
63c2c0ce73 Added NULL checks to class_respondsToSelector() 2011-02-12 11:03:41 +00:00
ericwa
9e64fb7828 undo accidentally commited stuff 2010-09-16 04:57:56 +00:00
ericwa
dbb8ea2090 add deprecated sel_eq function for compatibility 2010-09-16 04:53:16 +00:00
theraven
0284155f2d Added a hook that defines the behaviour when you call a method with the wrong signature. 2010-09-01 12:48:39 +00:00
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).
2010-08-31 20:40:08 +00:00
theraven
943ed5e714 Some source tidies. 2010-08-15 11:17:00 +00:00
theraven
2cc96a6f7e Fix message forwarding by, for example, actually calling the public forwarding hook, instead of one that isn't exposed to GNUstep... 2010-07-21 12:26:49 +00:00
theraven
378c7d3a6c Crash in the caller, instead of in the message lookup, when the method does not exist and there is no forwarding hook. 2010-07-20 09:47:26 +00:00
theraven
0e374db1db Added support for type-dependent dispatch to libobjc2. 2010-06-29 12:42:20 +00:00
theraven
b1b9baf382 Finished rewrite of message sending. Deleted lots of legacy stuff. 2010-06-03 15:17:12 +00:00
theraven
1a60fabf96 More 64-bit fixes. 2010-05-17 15:22:19 +00:00
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.
2010-05-16 20:39:54 +00:00
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.
2010-05-14 21:47:35 +00:00
theraven
ede942cdd8 Simplified profiling even more. Now should allow inlining of manually-cached IMPs. 2010-05-01 16:53:15 +00:00
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. 2010-05-01 13:54:47 +00:00
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. 2010-04-29 17:52:10 +00:00
theraven
fb26e9a9ef Disable sender-aware dispatch - it breaks some code. 2010-03-13 18:42:02 +00:00
rfm
301c01b2ae slightly more rigorous dtable handling. 2010-02-25 16:54:59 +00:00
theraven
eee7956bce Cleaner version of the last fix. 2010-02-25 16:34:05 +00:00
theraven
d4fe4f522e Fixed typo in comment in runtime.c.
Fixed unsafe dtable access in message lookup.
2010-02-25 16:32:31 +00:00
theraven
202006f6b8 Removed some dead variables. 2010-01-06 15:34:28 +00:00
theraven
f8b98a73a2 Bug fixes in libobjc2:
- nil_method now returns 0, not receiver.

- Metaclasses actually get their dtables installed with the new ABI.  For some reason this wasn't being done, so class messages didn't work with the new ABI.  Now they do and (at least some) nontrivial programs work.

- Undid commenting out of the code setting the fast ivar access pointers.  I can't remember why this was commented out, but it seems not to break anything.  I have an LLVM pass that makes compiled code access these pointers, but it's not committed yet.
2009-11-14 18:09:51 +00:00
theraven
1e1e23827c Fixed new ABI method lookup function for +initialize safety. 2009-09-20 15:48:57 +00:00
theraven
323e3dfaeb Added new runtime library, based on GCC 4.4 libobjc, libobjc_tr and Objective2.framework. 2009-09-08 16:18:59 +00:00