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

commits at source.squeak.org commits at source.squeak.org
Wed Apr 26 21:46:17 UTC 2017


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

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

Name: VMMaker.oscog-eem.2202
Author: eem
Time: 26 April 2017, 2:45:32.212149 pm
UUID: 664974d4-7a05-43ae-a940-515e14f5f110
Ancestors: VMMaker.oscog-cb.2201

Fix pc mapping issue with inlined identityhash primitive.  Inlined primitives are not mapped.
Fix extension issue with bc-mc mapping tests.  As elsewhere, the mapped bcpc is that of the prefixed bytecode, not the bytecode following the prefix.

=============== Diff against VMMaker.oscog-cb.2201 ===============

Item was changed:
  ----- Method: CogObjectRepresentationForSpur>>genGetIdentityHash:resultReg: (in category 'sista support') -----
  genGetIdentityHash: rcvrReg resultReg: resultReg
  	<var: #jumpSet type: #'AbstractInstruction *'>
  	| jumpSet |
  	"ReceiverResultReg is required for the trampoline. We force the allocation,
  	 and we have two path to avoid conflicts in ReceiverResultReg."
  	cogit voidReceiverResultRegContainsSelf. 
  	resultReg = ReceiverResultReg 
  		ifTrue: 
  			[cogit ssTop popToReg: rcvrReg.
  			 self genGetHashFieldNonImmOf: rcvrReg asSmallIntegerInto: resultReg.
  			 cogit CmpCq: ConstZero R: resultReg.
  			 jumpSet := cogit JumpNonZero: 0.
  			 cogit MoveR: rcvrReg R: resultReg.
+ 			 cogit CallRT: ceInlineNewHashTrampoline]
- 			 cogit CallRT: ceInlineNewHashTrampoline.
- 			 cogit annotateBytecode: cogit Label]
  		ifFalse: 
  			[cogit ssTop popToReg: ReceiverResultReg.
  		 	 self genGetHashFieldNonImmOf: ReceiverResultReg asSmallIntegerInto: resultReg.
  			 cogit CmpCq: ConstZero R: resultReg.
  			 jumpSet := cogit JumpNonZero: 0.
  			 cogit CallRT: ceInlineNewHashTrampoline.
+ 			 cogit MoveR: ReceiverResultReg R: resultReg].
- 			 cogit annotateBytecode: (cogit MoveR: ReceiverResultReg R: resultReg)].
  	jumpSet jmpTarget: cogit Label!

Item was changed:
  ----- Method: Cogit>>testBcToMcPcMappingForCogMethod: (in category 'testing') -----
  testBcToMcPcMappingForCogMethod: cogMethod
  	<doNotGenerate>
  	"self disassembleMethod: cogMethod"
  	"self printPCMapPairsFor: cogMethod on: Transcript"
  	| aMethodObj subMethods bsOffset |
  	aMethodObj := cogMethod methodObject.
  	subMethods := self subMethodsAsRangesFor: cogMethod.
  	subMethods first endPC: (self endPCOf: aMethodObj).
  	bsOffset := self bytecodeSetOffsetFor: aMethodObj.
  	self bcpcsDescriptorsAndStartpcsFor: aMethodObj bsOffset: bsOffset do:
  		[:bcpc :byte :desc :nExts :startpc|
  		(desc notNil and: [desc isBlockCreation]) ifTrue:
  			["dead code removal may result in blocks not being generated ;-)"
  			 (subMethods detect: [:sm| sm startpc = (bcpc + desc numBytes)] ifNone: [nil]) ifNotNil:
  				[:subMethod|
  				 subMethod endPC: bcpc + desc numBytes + (self spanFor: desc at: bcpc exts: -1 in: aMethodObj) - 1]]].
  	subMethods allButFirst do:
  		[:blockSubMethod| | cogBlockMethod |
  		cogBlockMethod := self
  								findMethodForStartBcpc: blockSubMethod startpc
  								inHomeMethod: cogMethod.
  		self assert: cogBlockMethod address = (blockSubMethod first - (self sizeof: CogBlockMethod))].
  	self bcpcsDescriptorsAndStartpcsFor: aMethodObj bsOffset: bsOffset do:
  		[:bcpc :byte :desc :nExts :startpc| | startBcpc currentSubMethod subCogMethod absMcpc mappedBcpc |
  		currentSubMethod := self innermostSubMethodFor: bcpc in: subMethods startingAt: 1.
  		startpc = currentSubMethod startpc ifTrue:
  			[subCogMethod := currentSubMethod cogMethod.
  			(subCogMethod stackCheckOffset > 0
  			 and: [desc isNil or: [desc isMapped 
  			 or: [inBlock = InFullBlock and: [desc isMappedInBlock]]]]) ifTrue:
  				[startBcpc := subCogMethod = cogMethod
  								ifTrue: [coInterpreter startPCOfMethod: aMethodObj]
  								ifFalse: [currentSubMethod startpc].
  				 "The first bytecode and backward branch bytecodes are mapped to their pc.
  				  Other bytecodes map to their following pc."
  				 absMcpc := (desc notNil
  							   and: [desc isBranch
  							   and: [self isBackwardBranch: desc at: bcpc exts: nExts in: aMethodObj]])
  								ifTrue: "Backward branches have a special mapper"
+ 									[mappedBcpc := bcpc - (2 * nExts).
- 									[mappedBcpc := bcpc.
  									 self
  										mcPCForBackwardBranch: mappedBcpc
  										startBcpc: startBcpc
  										in: subCogMethod]
  								ifFalse: "All others use the generic mapper"
  									[mappedBcpc := desc ifNil: [bcpc] ifNotNil: [bcpc + desc numBytes].
  									 self
  										mcPCFor: mappedBcpc
  										startBcpc: startBcpc
  										in: subCogMethod].
  				 self assert: absMcpc >= (subCogMethod asInteger + subCogMethod stackCheckOffset).
  				 self assert: (self bytecodePCFor: absMcpc startBcpc: startBcpc in: subCogMethod) = mappedBcpc]]]!



More information about the Vm-dev mailing list