[Vm-dev] byteSizeOf: is that correct for 64bit images? Also what
about the (sqInt)(long)
Bert Freudenberg
bert at freudenbergs.de
Sun Dec 20 23:56:01 UTC 2009
On 21.12.2009, at 00:44, David T. Lewis wrote:
>
>
> On Sun, Dec 20, 2009 at 02:45:59PM -0800, John M McIntosh wrote:
>>
>> Ok, I have to ask, is this correct? Er 4 or 8 or does it matter, do we have other '4' values embedded in the interpreter?
>> byteSizeOf: oop
>> | slots |
>> self flag: #Dan.
>> (self isIntegerObject: oop) ifTrue:[^0].
>> slots := self slotSizeOf: oop.
>> (self isBytesNonInt: oop)
>> ifTrue:[^slots]
>> ifFalse:[^slots * 4]
>>
>
> No, this is not correct, good catch. It should be:
>
> byteSizeOf: oop
> | slots |
> self flag: #Dan.
> (self isIntegerObject: oop) ifTrue:[^0].
> slots := self slotSizeOf: oop.
> (self isBytesNonInt: oop)
> ifTrue:[^slots]
> ifFalse:[^slots * ObjectMemory bytesPerWord]
>
> I've clean a lot of this crud out of the interpreter, but there are bound
> to be a few more that we have not spotted yet.
>
> Dave
>
Does "ObjectMemory bytesPerWord" compile to a constant?
- Bert -
More information about the Vm-dev
mailing list