[Vm-dev] VM Maker: VMMaker.oscog-nice.1747.mcz
commits at source.squeak.org
commits at source.squeak.org
Tue Mar 29 21:49:06 UTC 2016
Nicolas Cellier uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-nice.1747.mcz
==================== Summary ====================
Name: VMMaker.oscog-nice.1747
Author: nice
Time: 29 March 2016, 11:45:53.394 pm
UUID: 1b765c2a-8d50-4187-8dc2-216c4556a755
Ancestors: VMMaker.oscog-eem.1746
Correct undue sign extension wile promoting 32 to 64 bits int in fetchLong64:ofObject:
This was causing trouble in non spur object memory (V3) especially since I decided to generalize the usage of this message.
My feeling: we urgently need unsignedLong32At: to avoid these beautiful cast.
=============== Diff against VMMaker.oscog-eem.1746 ===============
Item was changed:
----- Method: ObjectMemory>>fetchLong64:ofObject: (in category 'object access') -----
fetchLong64: longIndex ofObject: oop
<returnTypeC: #sqLong>
^self cppIf: BytesPerWord = 8
ifTrue: [self long64At: oop + self baseHeaderSize + (longIndex << 3)]
ifFalse:
+ ["BEWARE OF SIGN EXTENSION ON LEAST SIGNIFICAND LIMB
+ 'unsigned int) CAST IS THERE TO PREVENT SUCH ERROR"
+ self cppIf: VMBIGENDIAN
- [self cppIf: VMBIGENDIAN
ifTrue: [((self long32At: oop + self baseHeaderSize + (longIndex << 3)) asUnsignedLongLong << 32)
+ + (self cCoerceSimple: (self long32At: oop + self baseHeaderSize + (longIndex << 3 + 4)) to: #'unsigned int')]
+ ifFalse: [(self cCoerceSimple: (self long32At: oop + self baseHeaderSize + (longIndex << 3)) to: #'unsigned int')
- + (self long32At: oop + self baseHeaderSize + (longIndex << 3 + 4))]
- ifFalse: [(self long32At: oop + self baseHeaderSize + (longIndex << 3))
+ ((self long32At: oop + self baseHeaderSize + (longIndex << 3 + 4)) asUnsignedLongLong << 32)]]!
More information about the Vm-dev
mailing list