[Vm-dev] VM Maker: VMMaker.oscog-eem.917.mcz
commits at source.squeak.org
commits at source.squeak.org
Mon Nov 3 02:41:22 UTC 2014
Eliot Miranda uploaded a new version of VMMaker to project VM Maker:
http://source.squeak.org/VMMaker/VMMaker.oscog-eem.917.mcz
==================== Summary ====================
Name: VMMaker.oscog-eem.917
Author: eem
Time: 2 November 2014, 7:38:07.226 pm
UUID: 01a47aaa-5fab-45fc-ada3-3c26b0d51edd
Ancestors: VMMaker.oscog-eem.916
Fix bad bug in callPrimitiveBytecode. Old code
skipped past next bytecode. This broke code
depending on ContextPart>>restart, such as Exception>>retry.
=============== Diff against VMMaker.oscog-eem.916 ===============
Item was changed:
----- Method: StackInterpreter>>callPrimitiveBytecode (in category 'miscellaneous bytecodes') -----
callPrimitiveBytecode
"V4: 249 11111001 i i i i i i i i jjjjjjjj Call Primitive #iiiiiiii + (jjjjjjjj * 256)
SistaV1: 248 11111000 iiiiiiii mjjjjjjj Call Primitive #iiiiiiii + (jjjjjjj * 256) m=1 means inlined primitive, no hard return after execution.
V3/Spur: 139 10001011 i i i i i i i i jjjjjjjj Call Primitive #iiiiiiii + (jjjjjjjj * 256)"
"Note that we simply skip a callPrimitiveBytecode at the start of a method
that contains a primitive. This because methods like Context(Part)>>reset
have to be updated to skip the callPrimtiive bytecode otherwise."
self cppIf: SistaVM
ifTrue:
[| byte1 byte2 prim header |
byte1 := self fetchByte.
byte2 := self fetchByte.
self fetchNextBytecode.
byte2 < 128 ifTrue:
+ [header := objectMemory methodHeaderOf: method.
- [header := self methodHeaderOf: method.
((self methodHeaderHasPrimitive: header)
and: [localIP = (self initialPCForHeader: header method: method) + (self sizeOfCallPrimitiveBytecode: header)]) ifTrue:
[^self].
localIP := localIP - 3.
^self respondToUnknownBytecode].
prim := byte2 - 128 << 8 + byte1.
prim < 1000 ifTrue:
[^self nullaryInlinePrimitive: prim].
prim < 2000 ifTrue:
[^self unaryInlinePrimitive: prim - 1000].
prim < 3000 ifTrue:
[^self binaryInlinePrimitive: prim - 2000].
prim < 4000 ifTrue:
[^self trinaryInlinePrimitive: prim - 3000].
localIP := localIP - 3.
^self respondToUnknownBytecode]
ifFalse:
[| header |
+ header := objectMemory methodHeaderOf: method.
- header := self methodHeaderOf: method.
((self methodHeaderHasPrimitive: header)
and: [localIP asInteger = (self initialPCForHeader: header method: method)])
ifTrue:
+ [localIP := localIP + (self sizeOfCallPrimitiveBytecode: header) - 1.
- [localIP := localIP + (self sizeOfCallPrimitiveBytecode: header).
^self fetchNextBytecode]
ifFalse:
[^self respondToUnknownBytecode]]!
More information about the Vm-dev
mailing list