Commit Graph

842 Commits

Author SHA1 Message Date
theraven
752b7ec9d8 Another fix for allocating runtime classes. 2010-01-07 13:31:18 +00:00
theraven
da9aafd3ed More fixes for bugs found by Mizuki. 2010-01-06 22:28:59 +00:00
theraven
2a5ba9f18a Fixed class_get_super_class() so that it actually works and simplified class_getSuperclass() to call it directly. This fixes numerous other corner cases, for example you can now throw a constant string as an exception and have it work correctly even if no constant string objects have been sent messages.
Hopefully this will fix a few other Heisenbugs and reduce the strength of the Mottola Effect.
2010-01-06 18:11:39 +00:00
theraven
202006f6b8 Removed some dead variables. 2010-01-06 15:34:28 +00:00
theraven
51ab4a935a Fixed class_getSuperclass() implementation. 2010-01-05 16:47:28 +00:00
theraven
604efa7077 Add new classes to the class table when they are registered. 2010-01-05 14:39:14 +00:00
theraven
81de407358 Fixed method_getNumberOfArguments(), report by Mizuki. 2010-01-05 14:26:02 +00:00
theraven
028a312ecd Fixed bugs found by Mizuki. 2010-01-05 13:52:35 +00:00
theraven
9dc0343c21 Fixed ivar offset checking to take account for alignment. 2010-01-05 13:52:02 +00:00
theraven
6a94efd4cf Removed debugging lines from GNUmakefile that were breaking the build. Thanks to RFM for spotting this... 2010-01-05 13:51:35 +00:00
rfm
6e29945894 Fix missing return 2010-01-04 18:00:34 +00:00
theraven
41f9e12f53 Added a bit more debugging info to the overlapping class error. 2010-01-04 15:01:59 +00:00
theraven
16c3ec8f46 Correctly declare the runtime hooks as extern. Was causing copies of them to show up in the uninitialised data section of libraries that included runtime.h, clobbering the default version and causing a crash when the runtime tried to call them. 2010-01-02 17:45:10 +00:00
qmathe
bf2521da40 Fixed undefined pthread references when gnustep-base configure tests whether 'objc really works' 2009-12-30 16:01:38 +00:00
qmathe
8b9c723905 Added object_setClass 2009-12-27 22:00:44 +00:00
theraven
7ba27bd183 Fixed license for NSBlocks.m 2009-12-20 19:38:07 +00:00
theraven
93ac6e7f2f Fixed block class creation so libobjc2 no longer has a static dependency on NSObject. This lets blocks work without Foundation, just as on OS X. This requires GNUstep to call a runtime function when NSObject is loaded. 2009-12-20 16:49:27 +00:00
theraven
4771cd4e43 Added selector lookup functions. Implementations by Eric Wasylishen. 2009-11-25 14:42:52 +00:00
theraven
7af08f5a82 Tweaked the +initialize order to work around some of the insanity in NSObject and NSAutoreleasePool's interaction in GNUstep. This code is incredibly fragile, and on the old runtime sometimes completely fails and crashes during startup, depending on the order in which the files were linked in -base and how the platform linker works. Hopefully now it should work in all cases. 2009-11-24 13:23:47 +00:00
theraven
5f48260c6a Made sure the ObjC mutex is created before it might first be used. 2009-11-24 13:21:29 +00:00
theraven
8efbf98e55 Fixed potential load-order conflict in NSBlocks. 2009-11-24 13:20:48 +00:00
theraven
cbf41a1fec Fixed build with clang. 2009-11-17 23:28:58 +00:00
theraven
baed61c3e6 Added property support functions, NSBlock base classes and uncaught exception handler. 2009-11-17 21:13:41 +00:00
theraven
40da5b6b50 Fixed build warning on *BSD. 2009-11-17 21:12:42 +00:00
theraven
bd73cc4e57 Added run-time abort if the first ivar of a newly-loaded class does not immediately follow on from the previous one. This (hopefully, modulo some potential weirdness related to bitfields) means that we should now get programs refusing to start in most cases where they depend on frameworks that had their ABI change but didn't bump the library version. This seems preferable to the previous behaviour of corrupting memory (note that this won't catch the case where the superclass has its ivars rearranged, but remains exactly the same size and the subclass references the ivars). 2009-11-15 02:28:45 +00:00
theraven
3ffec0a4fb Added missing declarations of exception-handling functions (from ABI spec). 2009-11-15 02:25: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
29790da51c Fixed bug in loading categories. 2009-11-13 18:28:01 +00:00
theraven
b2bc15c64e Removed assertion. I'm not entirely sure why it was there, but it was preventing Gorm running (along with anything else that provided categories on subclassed classes). I need some more testing to make sure that this didn't break anything else, but Gorm now runs correctly with the new runtime, so it seems like an improvement... 2009-10-25 15:47:57 +00:00
theraven
5bb7c43244 Fixed accidental insertion of methods into the uninitialized dtable. 2009-10-24 15:56:42 +00:00
theraven
546f31df69 Fixed a load of ->dtable references up to dtable_for_class() calls. Now no longer does the Wrong Thing™ if you do silly things like modifying a class's dtable in +initialize (which, sadly, GNUstep does for NSConstantString). 2009-10-24 15:16:14 +00:00
theraven
b69b7c05d8 Removed unwind.h dependency. Tidied up a few warnings generated by clang. 2009-10-04 15:41:32 +00:00
theraven
2800dee1f4 Changed "unwind.h" to <unwind.h> 2009-10-04 14:55:57 +00:00
theraven
1e1e23827c Fixed new ABI method lookup function for +initialize safety. 2009-09-20 15:48:57 +00:00
theraven
d010cc60ea Fix for threading bug with +initialize. Some limitations:
- Now only one thread may be in any +initialize method at once.
- Not yet implemented for the new ABI lookup function.

The first I don't see as a limitation; if anything having +initialize methods
be guaranteed not to run concurrently may be convenient.  The second I will fix
soon.
2009-09-20 12:46:45 +00:00
rfm
3c43365991 Use _XOPEN_SOURCE rather than _XOPEN_VERSION 2009-09-13 11:51:27 +00:00
theraven
9c65b1c84c Added types support to blocks runtime, tidied up UNIX98 stuff. 2009-09-11 10:28:49 +00:00
rfm
102084ab7c Changes to compile on CentOS-5.3 2009-09-11 08:21:58 +00:00
theraven
bba507bf70 Removed incorrect comment from blocks runtime. Tweaked runtime.h to make it show the new functions even in GNU-compat mode and made sure the object-substitution hook is called even when object substitution can't be used, so GNUstep can use it for the 10.5 NSObject runtime functions. 2009-09-10 22:09:03 +00:00
theraven
252447c95f Updated block interface to more closely match Apple's one. Added support for introspectable blocks. 2009-09-10 01:24:25 +00:00
theraven
3038121d27 Flagged non-Apple-compatible parts of the API as non-portable. 2009-09-08 21:56:31 +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