[Vm-dev] VM Maker: BytecodeSets-eem.10.mcz

commits at source.squeak.org commits at source.squeak.org
Sat Aug 9 02:43:46 UTC 2014


Eliot Miranda uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets-eem.10.mcz

==================== Summary ====================

Name: BytecodeSets-eem.10
Author: eem
Time: 8 August 2014, 7:43:38.17 pm
UUID: e2e38071-eb47-41b0-a0d0-e4f444c38451
Ancestors: BytecodeSets-eem.9

Update the Sista inline prim specification, including some
0 arg prims, and grouping the prims by arg count in steps
of 1000, leaving lots of room for expansion.

Fix the range of EncoderForSistaV1>>genCallPrimitive: to
accomodate inlined prims.

Add a callPrimitive: in InstructionClient, hence enabling the
MethodMassage assembler.

=============== Diff against BytecodeSets-eem.9 ===============

Item was added:
+ ----- Method: BytecodeEncoder class>>stackDeltaForPrimitive:in: (in category '*BytecodeSets-bytecode decoding') -----
+ stackDeltaForPrimitive: primitiveIndex in: method
+ 	"This is the default implementation.  Subclasses with inline primitives will need to override."
+ 	^0!

Item was changed:
  BytecodeEncoder subclass: #EncoderForSistaV1
(excessive size, no diff calculated)

Item was added:
+ ----- Method: EncoderForSistaV1 class>>stackDeltaForPrimitive:in: (in category '*BytecodeSets-bytecode decoding') -----
+ stackDeltaForPrimitive: primitiveIndex in: method
+ 	"Answer the stack delta for the callPrimitive: bytecode (see my class comment).
+ 	 There is no delta for non-inlined primitives (its implicitly 0 - method numArgs).
+ 	 Inlined primitives are grouped by the thousand by argument count, 32 args max ;-)."
+ 	^primitiveIndex < 32678
+ 		ifTrue: [0]
+ 		ifFalse: [primitiveIndex - 32768 // 1000]!

Item was changed:
  ----- Method: EncoderForSistaV1>>genCallPrimitive: (in category 'bytecode generation') -----
  genCallPrimitive: primitiveIndex
  	"248		11111000	i i i i i i i i	0jjjjjjj		Call Primitive #iiiiiiii + (jjjjjjj * 256)"
  	"N.B. We could have made CallPrimitive a 2-byte code taking an extension, but that would
  	 complicate the VM's determination of the primitive number and the primitive error code
  	 store since the extension, being optional, would make the sequence variable length."
+ 	(primitiveIndex < 1 or: [primitiveIndex > 65535]) ifTrue:
+ 		[self outOfRangeError: 'primitive index' index: primitiveIndex range: 1 to: 65535].
- 	(primitiveIndex < 1 or: [primitiveIndex > 32767]) ifTrue:
- 		[self outOfRangeError: 'primitive index' index: primitiveIndex range: 1 to: 32767].
  	stream
  		nextPut: 248;
  		nextPut: (primitiveIndex bitAnd: 255);
  		nextPut: (primitiveIndex bitShift: -8)!

Item was added:
+ ----- Method: InstructionClient>>callPrimitive: (in category '*BytecodeSets-instruction decoding') -----
+ callPrimitive: pimIndex
+ 	"SqueakV3PlusClosures:	239 11101111	iiiiiiii   jjjjjjjj  Call Primitive #iiiiiiii + (jjjjjjjj * 256)
+ 	 NewsqueakV4:				249 11111001	iiiiiiii   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."!



More information about the Vm-dev mailing list