Review Board

1.0

LanguageKit fixes for merging to stable

Updated 1 year, 5 months ago

David Chisnall Reviewers
stable EtoileCore
tbe
None Étoilé Stable
This contains:

Fixes to LKIfStatement, including Truls' work for supporting local returns (see LKReturn).

Significantly improved overflow-checking arithmetic routines.  These are in MsgSendSmallInt.m and are both (significantly) faster and more correct.

Fixes to make the two non-local return tests pass.
Run the test suite.  TestNonLocalReturn and TestNonLocalReturn2 now pass (previously they did not).

Ran Fibonacci benchmark.  Now close to ObjC performance (previously factor of 30 or so slower).

Still fails tests that involve returning structures containing floats on FreeBSD.
Posted 1 year, 5 months ago (April 11th, 2009, 9:06 a.m.)

   

  
Would be clearer with something like:
… and set the low bit spuriously in smalltalk_overflow_handler() when returning a bit integer. The line below then clears that bit.
Ship it!
Posted 1 year, 5 months ago (April 11th, 2009, 9:15 a.m.)
Everything looks ok to me. Feel free to merge it into stable.

For OverflowHandler.m, I would suggest to use PLUS and MUL to help the readability. plus: and mul: selector keywords are a bit hard to spot.

Also finish the line: // We set the low bit here so that we can use XOR to set it with SmallIntMsgmul_() in MsgSendSmallInt.m

#define PLUS 1
#define MUL 3

		case PLUS:
			return (long long)(intptr_t)
				[[BigInt bigIntWithLongLong:((long long)val) >> 1]
				plus:[BigInt bigIntWithLongLong:((long long)otherval) >> 1]];
		case MUL:
		{
			id bigInt = [[BigInt bigIntWithLongLong:((long long)val) >> 1]
				mul:[BigInt bigIntWithLongLong:((long long)otherval) >> 1]];
			// We set the low bit here so that we can use XOR to set it in the <-----
			return (long long)(((intptr_t)bigInt) | 1);
		}