|
From: Ian P. <ian...@in...> - 2004-04-06 22:48:48
|
On 06 Apr 2004, at 23:50, Yoshiki Ohshima wrote: > how about using "01" for OOP > and "00" for SmallInteger? Some processor's addressing mode let us > access the word-aligned memory with such pointer, while "no-tag" for > SmallInteger may save some bit-operations. Just another data point: some Smalltalk implementations put the SmallInteger tag in the topmost bit. This makes SI tag and overflow checks after arithmetic simpler: addition and subtraction work in-place, plus you can just look at the sign flag after the operation instead of "mask + test-zero" or "shift + xor + sign-test". On architectures where you can set the sign flag during move this can also often eliminate any need to mask and test on the tag bit; after a move you can "trap" immediately on (non-)SI oops. Cheers, Ian |