[Vm-dev] VM Maker: VMMaker.oscog-eem.1148.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 1 22:49:27 UTC 2015


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

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

Name: VMMaker.oscog-eem.1148
Author: eem
Time: 1 April 2015, 3:47:27.079 pm
UUID: b67f9693-ad92-4951-ad6b-a62a64bf4ddb
Ancestors: VMMaker.oscog-eem.1147

Define startpc in closure creation jitting appropriately (and hence correctly for Sista)

=============== Diff against VMMaker.oscog-eem.1147 ===============

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genExtPushClosureBytecode (in category 'bytecode generators') -----
  genExtPushClosureBytecode
  	"Block compilation.  At this point in the method create the block.  Note its start
  	 and defer generating code for it until after the method and any other preceeding
  	 blocks.  The block's actual code will be compiled later."
  	"253		11111101 eei i i kkk	jjjjjjjj		Push Closure Num Copied iii (+ Ext A // 16 * 8) Num Args kkk (+ Ext A \\ 16 * 8) BlockSize jjjjjjjj (+ Ext B * 256). ee = num extensions"
+ 	| startpc numArgs numCopied |
- 	| numArgs numCopied |
  	self assert: needsFrame.
+ 	startpc := bytecodePC + (self generatorAt: byte0) numBytes.
+ 	self addBlockStartAt: startpc "0 relative"
- 	self addBlockStartAt: bytecodePC + 3 "0 relative"
  		numArgs: (numArgs := (byte1 bitAnd: 16r7) + (extA \\ 16 * 8))
  		numCopied: (numCopied := ((byte1 >> 3) bitAnd: 7) + (extA // 16 * 8))
  		span: byte2 + (extB << 8).
  	extA := extB := 0.
  
  	objectRepresentation createsClosuresInline ifTrue:
  		[self assert: objectRepresentation getActiveContextAllocatesInMachineCode.
  		 optStatus isReceiverResultRegLive: false.
  		 self ssAllocateCallReg: ReceiverResultReg
  			and: SendNumArgsReg
  			and: ClassReg.
  		 objectRepresentation
+ 			genNoPopCreateClosureAt: startpc + 1 "1 relative"
- 			genNoPopCreateClosureAt: bytecodePC + 4 "1 relative"
  			numArgs: numArgs
  			numCopied: numCopied
  			contextNumArgs: methodOrBlockNumArgs
  			large: (coInterpreter methodNeedsLargeContext: methodObj)
  			inBlock: inBlock.
  		 1 to: numCopied do:
  			[:i| | reg |
  			 reg := self ssStorePop: true toPreferredReg: TempReg.
  			 objectRepresentation
  				genStoreSourceReg: reg
  				slotIndex: ClosureFirstCopiedValueIndex + numCopied - i
  				intoNewObjectInDestReg: ReceiverResultReg].
  		 ^self ssPushRegister: ReceiverResultReg].
  
  	numCopied > 0 ifTrue:
  		[self ssFlushTo: simStackPtr].
  	optStatus isReceiverResultRegLive: false.
  	objectRepresentation getActiveContextAllocatesInMachineCode
  		ifTrue: [self ssAllocateCallReg: ReceiverResultReg
  					and: SendNumArgsReg
  					and: ClassReg]
  		ifFalse: [self ssAllocateCallReg: SendNumArgsReg
  					and: ReceiverResultReg].
  	objectRepresentation
+ 		genCreateClosureAt: startpc + 1 "1 relative"
- 		genCreateClosureAt: bytecodePC + 4 "1 relative"
  		numArgs: numArgs
  		numCopied: numCopied
  		contextNumArgs: methodOrBlockNumArgs
  		large: (coInterpreter methodNeedsLargeContext: methodObj)
  		inBlock: inBlock.
  	numCopied > 0 ifTrue:
  		[self ssPop: numCopied].
  	^self ssPushRegister: ReceiverResultReg!

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genPushClosureCopyCopiedValuesBytecode (in category 'bytecode generators') -----
  genPushClosureCopyCopiedValuesBytecode
  	"Block compilation.  At this point in the method create the block.  Note its start
  	 and defer generating code for it until after the method and any other preceeding
  	 blocks.  The block's actual code will be compiled later."
  	"143   10001111 llllkkkk jjjjjjjj iiiiiiii	Push Closure Num Copied llll Num Args kkkk BlockSize jjjjjjjjiiiiiiii"
+ 	| startpc numArgs numCopied |
- 	| numArgs numCopied |
  	self assert: needsFrame.
+ 	startpc := bytecodePC + (self generatorAt: byte0) numBytes.
+ 	self addBlockStartAt: startpc "0 relative"
- 	self addBlockStartAt: bytecodePC + 4 "0 relative"
  		numArgs: (numArgs := byte1 bitAnd: 16rF)
  		numCopied: (numCopied := byte1 >> 4)
  		span: (byte2 << 8) + byte3.
  
  	objectRepresentation createsClosuresInline ifTrue:
  		[self assert: objectRepresentation getActiveContextAllocatesInMachineCode.
  		 optStatus isReceiverResultRegLive: false.
  		 self ssAllocateCallReg: ReceiverResultReg
  			and: SendNumArgsReg
  			and: ClassReg.
  		 objectRepresentation
+ 			genNoPopCreateClosureAt: startpc + 1 "1 relative"
- 			genNoPopCreateClosureAt: bytecodePC + 5 "1 relative"
  			numArgs: numArgs
  			numCopied: numCopied
  			contextNumArgs: methodOrBlockNumArgs
  			large: (coInterpreter methodNeedsLargeContext: methodObj)
  			inBlock: inBlock.
  		 1 to: numCopied do:
  			[:i| | reg |
  			 reg := self ssStorePop: true toPreferredReg: TempReg.
  			 objectRepresentation
  				genStoreSourceReg: reg
  				slotIndex: ClosureFirstCopiedValueIndex + numCopied - i
  				intoNewObjectInDestReg: ReceiverResultReg].
  		 ^self ssPushRegister: ReceiverResultReg].
  
  	numCopied > 0 ifTrue:
  		[self ssFlushTo: simStackPtr].
  	optStatus isReceiverResultRegLive: false.
  	objectRepresentation getActiveContextAllocatesInMachineCode
  		ifTrue: [self ssAllocateCallReg: ReceiverResultReg
  					and: SendNumArgsReg
  					and: ClassReg]
  		ifFalse: [self ssAllocateCallReg: SendNumArgsReg
  					and: ReceiverResultReg].
  	objectRepresentation
+ 		genCreateClosureAt: startpc + 1 "1 relative"
- 		genCreateClosureAt: bytecodePC + 5 "1 relative"
  		numArgs: numArgs
  		numCopied: numCopied
  		contextNumArgs: methodOrBlockNumArgs
  		large: (coInterpreter methodNeedsLargeContext: methodObj)
  		inBlock: inBlock.
  	numCopied > 0 ifTrue:
  		[self ssPop: numCopied].
  	^self ssPushRegister: ReceiverResultReg!



More information about the Vm-dev mailing list