[Vm-dev] VM Maker: VMMaker.oscog-eem.990.mcz
commits at source.squeak.org
commits at source.squeak.org
Wed Dec 17 21:55:40 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.990.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.990
Author: eem
Time: 17 December 2014, 1:52:54.55 pm
UUID: f4a22308-891c-4542-b6a4-10fe174bc82a
Ancestors: VMMaker.oscog-tpr.989
Fix bitInvert32 for 64-bits. Now window border
colours are correct in the 64-bit Spur Stack linux VM.
Cast a left shift to long if in the 64-bit interpreter
code.
Fix printFreeListHeads
=============== Diff against VMMaker.oscog-tpr.989 ===============
Item was changed:
----- Method: CCodeGenerator>>generateBitInvert:on:indent: (in category 'C translation') -----
generateBitInvert: msgNode on: aStream indent: level
+ "Generate the C code for this message onto the given stream.
+ If the selector is bitInvert32 then cast to unsigned int to ensure
+ a 32-bit value on 64-bit platforms."
- "Generate the C code for this message onto the given stream."
+ | castToUnsignedInt |
+ castToUnsignedInt := msgNode selector = #bitInvert32.
+ castToUnsignedInt ifTrue:
+ [aStream nextPutAll: '(unsigned int)'].
aStream nextPut: $~.
self emitCExpression: msgNode receiver on: aStream!
Item was changed:
----- Method: CCodeGenerator>>generateShiftLeft:on:indent: (in category 'C translation') -----
generateShiftLeft: msgNode on: aStream indent: level
"Generate a C bitShift. If we can determine the result
would overflow the word size, cast to a long integer."
| rcvr arg valueBeyondInt castToLong |
rcvr := msgNode receiver.
arg := msgNode args first.
valueBeyondInt := 1 bitShift: 32. "The default type of const << N is int."
+ castToLong := vmClass notNil and: [vmClass objectMemoryClass wordSize = 8].
+ castToLong ifFalse:
+ [rcvr constantNumbericValueOrNil ifNotNil:
+ [:rcvrVal|
+ arg constantNumbericValueOrNil ifNotNil:
+ [:argVal|
+ castToLong := rcvrVal < valueBeyondInt
+ and: [(rcvrVal bitShift: argVal) >= valueBeyondInt]]]].
- castToLong := false.
- rcvr constantNumbericValueOrNil ifNotNil:
- [:rcvrVal|
- arg constantNumbericValueOrNil ifNotNil:
- [:argVal|
- castToLong := rcvrVal < valueBeyondInt
- and: [(rcvrVal bitShift: argVal) >= valueBeyondInt]]].
castToLong
ifTrue:
+ [(rcvr isConstant and: [rcvr name isEmpty])
- [rcvr isConstant
ifTrue:
[self emitCExpression: rcvr on: aStream.
aStream nextPutAll: 'LL']
ifFalse:
+ [aStream nextPutAll: '((long)'.
- [aStream nextPutAll: '((unsigned long)'.
self emitCExpression: rcvr on: aStream.
aStream nextPut: $)]]
ifFalse:
[self emitCExpression: rcvr on: aStream].
aStream nextPutAll: ' << '.
self emitCExpression: arg on: aStream!
Item was changed:
----- Method: SpurMemoryManager>>printFreeListHeads (in category 'debug printing') -----
printFreeListHeads
<api>
| expectedMask |
expectedMask := 0.
0 to: self numFreeLists - 1 do:
[:i|
coInterpreter printHex: (freeLists at: i).
(freeLists at: i) ~= 0 ifTrue:
[expectedMask := expectedMask + (1 << i)].
+ i + 1 \\ (32 >> self logBytesPerOop) = 0
- i \\ (32 >> self logBytesPerOop) = 0
ifTrue: [coInterpreter cr]
+ ifFalse: [coInterpreter print: ' ']].
- ifFalse: [coInterpreter tab]].
coInterpreter
+ cr;
+ print: 'mask: '; printHexnp: freeListsMask;
+ print: ' expected: '; printHexnp: expectedMask;
- print: 'mask: '; printHex: freeListsMask;
- print: ' expected: '; printHex: expectedMask;
cr!
More information about the Vm-dev
mailing list