[Vm-dev] VM Maker: BytecodeSets.spur-cb.55.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Jul 25 12:28:33 UTC 2016


ClementBera uploaded a new version of BytecodeSets to project VM Maker:
http://source.squeak.org/VMMaker/BytecodeSets.spur-cb.55.mcz

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

Name: BytecodeSets.spur-cb.55
Author: cb
Time: 25 July 2016, 2:28:27.232448 pm
UUID: b792defd-c24f-42f6-884f-36206232a99b
Ancestors: BytecodeSets.spur-eem.54

Making sistaV1 bytecode set ready for release.
- ExtB is signed 
- ExtA is unsigned
- get rid of pushNClosureTemp (we're migrating to FullBlock)
- remove push float
- make full block 249 to have all 3 bytes push next to each other
- Added specification for unsafe operations sets.
- Added / fixed some specification for sista unsafe operations.

=============== Diff against BytecodeSets.spur-eem.54 ===============

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

Item was changed:
  ----- Method: EncoderForSistaV1>>genCallInlinePrimitive: (in category 'extended bytecode generation') -----
  genCallInlinePrimitive: primitiveIndex
+ 	"	248	(2)	11111000 	iiiiiiii		mssjjjjj		Call Primitive #iiiiiiii + (jjjjj * 256) 
+ 								m=1 means inlined primitive, no hard return after execution. 
+ 								ss defines the unsafe operation set used to encode the operations. 
+ 								(ss = 0 means sista unsafe operations, ss = 01 means lowcode operations, other numbers are not used)"
- 	"248		11111000	i i i i i i i i	1jjjjjjj		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 > 32767]) ifTrue:
  		[self outOfRangeError: 'primitive index' index: primitiveIndex range: 1 to: 32767].
  	stream
  		nextPut: 248;
  		nextPut: (primitiveIndex bitAnd: 255);
  		nextPut: (primitiveIndex bitShift: -8) + 128!

Item was changed:
  ----- Method: EncoderForSistaV1>>genCallPrimitive: (in category 'bytecode generation') -----
  genCallPrimitive: primitiveIndex
+ 	"248	(2)	11111000 	iiiiiiii		mssjjjjj		Call Primitive #iiiiiiii + (jjjjj * 256) 
+ 								m=1 means inlined primitive, no hard return after execution. 
+ 								ss defines the unsafe operation set used to encode the operations. 
+ 								(ss = 0 means sista unsafe operations, ss = 01 means lowcode operations, other numbers are not used)"
- 	"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].
  	stream
  		nextPut: 248;
  		nextPut: (primitiveIndex bitAnd: 255);
  		nextPut: (primitiveIndex bitShift: -8)!

Item was changed:
  ----- Method: EncoderForSistaV1>>genPushFullClosure:numCopied:receiverOnStack:outerContextNeeded: (in category 'extended bytecode generation') -----
  genPushFullClosure: compiledBlockLiteralIndex numCopied: numCopied receiverOnStack: receiverOnStack outerContextNeeded: outerContextNeeded
+ 	"*	249		11111001 	xxxxxxxx	siyyyyyy	push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 ignoreOuterContext: i = 1"
- 	"*	255		11111111	xxxxxxxx	siyyyyyy	push Closure Compiled block literal index xxxxxxxx (+ Extend A * 256) numCopied yyyyyy receiverOnStack: s = 1 ignoreOuterContext: i = 1"
  	| extendedIndex |
  	(numCopied < 1 or: [numCopied > 64]) ifTrue:
  		[self outOfRangeError: 'num copied' index: numCopied range: 1 to: 64].
  	(compiledBlockLiteralIndex < 0 or: [compiledBlockLiteralIndex > 32768]) ifTrue:
  		[^self outOfRangeError: 'index' index: compiledBlockLiteralIndex range: 0 to: 32768].
  	(extendedIndex := compiledBlockLiteralIndex) > 255 ifTrue:
  		[self genUnsignedSingleExtendA: extendedIndex // 256.
  		 extendedIndex := extendedIndex \\ 256].
  	stream
+ 		nextPut: 249;
- 		nextPut: 255;
  		nextPut: extendedIndex;
  		nextPut: receiverOnStack asBit << 7 + (outerContextNeeded not asBit << 6) + numCopied!

Item was changed:
  ----- Method: EncoderForSistaV1>>genPushNClosureTemps: (in category 'bytecode generation') -----
  genPushNClosureTemps: numTemps
+ 	"Not supported anymore since we're migrating to FullBlockClosure"
+ 	self notify: 'This instruction should not be used any more'.
+ 	"backward compatibility..."
+ 	numTemps timesRepeat: [ self genPushSpecialLiteral: nil ]!
- 	"	230		11100110	iiiiiiii		PushNClosureTemps iiiiiiii"
- 	(numTemps < 0 or: [numTemps >= 64]) ifTrue:
- 		[^self outOfRangeError: 'closure num temps' index: numTemps range: 0 to: 127].
- 	stream nextPut: 230.
- 	stream nextPut: numTemps!

Item was changed:
  ----- Method: EncoderForSistaV1>>genUnsignedSingleExtendA: (in category 'bytecode generation') -----
  genUnsignedSingleExtendA: extendedIndex
  	(extendedIndex between: 0 and: 255) ifFalse:
  		[^self outOfRangeError: 'index' index: extendedIndex range: 0 to: 255].
+ 	"224		11100000	aaaaaaaa	Extend A (Ext A = Ext A prev * 256 + Ext A)
+ 	ExtA is normally unsigned."
- 	"224		11100000	aaaaaaaa	Extend A (Ext A = Ext A prev * 256 + Ext A)"
  	stream
  		nextPut: 224;
  		nextPut: extendedIndex!

Item was changed:
  ----- Method: EncoderForSistaV1>>genUnsignedSingleExtendB: (in category 'bytecode generation') -----
  genUnsignedSingleExtendB: extendedIndex
  	(extendedIndex between: 0 and: 255) ifFalse:
  		[^self outOfRangeError: 'index' index: extendedIndex range: 0 to: 255].
+ 	"225		11100001	sbbbbbbb	Extend B (Ext B = Ext B prev * 256 + Ext B).
+ 	ExtB is normally signed"
- 	"225		11100001	sbbbbbbb	Extend B (Ext B = Ext B prev * 256 + Ext B)"
  	stream
  		nextPut: 225;
  		nextPut: extendedIndex!



More information about the Vm-dev mailing list