[Vm-dev] VM Maker: VMMaker.oscog-cb.1289.mcz

commits at source.squeak.org commits at source.squeak.org
Wed May 6 07:28:14 UTC 2015


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

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

Name: VMMaker.oscog-cb.1289
Author: cb
Time: 6 May 2015, 9:26:52.521 am
UUID: e7a5f914-5989-4493-8941-936984bdd80a
Ancestors: VMMaker.oscog-eem.1288

Increased the opcode size heuristic in the SistaCogit. Maybe I'll figure out something better if I rewrite the #== logic.

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

Item was changed:
  ----- Method: Cogit>>compileCogMethod: (in category 'compile abstract instructions') -----
  compileCogMethod: selector
  	<returnTypeC: #'CogMethod *'>
  	| numBytecodes numBlocks numCleanBlocks result extra |
  	hasYoungReferent := (objectMemory isYoungObject: methodObj)
  						  or: [objectMemory isYoung: selector].
  	methodOrBlockNumArgs := coInterpreter argumentCountOf: methodObj.
  	inBlock := false.
  	primInvokeLabel := nil.
  	postCompileHook := nil.
  	maxLitIndex := -1.
  	extra := ((primitiveIndex := coInterpreter primitiveIndexOf: methodObj) > 0
  			and: [(coInterpreter isQuickPrimitiveIndex: primitiveIndex) not])
  				ifTrue: [30]
  				ifFalse: [10].
  	initialPC := coInterpreter startPCOfMethod: methodObj.
  	"initial estimate.  Actual endPC is determined in scanMethod."
  	endPC := (coInterpreter isQuickPrimitiveIndex: primitiveIndex)
  					ifTrue: [initialPC - 1]
  					ifFalse: [objectMemory numBytesOf: methodObj].
  	numBytecodes := endPC - initialPC + 1.
+ 	self allocateOpcodes: (numBytecodes + extra) * self estimateOfAbstractOpcodesPerBytecodes
- 	self allocateOpcodes: (numBytecodes + extra) * 10
  		bytecodes: numBytecodes
  		ifFail: [^coInterpreter cCoerceSimple: MethodTooBig to: #'CogMethod *'].
  	(numBlocks := self scanMethod) < 0 ifTrue:
  		[^coInterpreter cCoerceSimple: numBlocks to: #'CogMethod *'].
  	numCleanBlocks := self scanForCleanBlocks.
  	self allocateBlockStarts: numBlocks + numCleanBlocks.
  	blockCount := 0.
  	numCleanBlocks > 0 ifTrue:
  		[self addCleanBlockStarts].
  	(self maybeAllocAndInitCounters
  	 and: [self maybeAllocAndInitIRCs]) ifFalse: "Inaccurate error code, but it'll do.  This will likely never fail."
  		[^coInterpreter cCoerceSimple: InsufficientCodeSpace to: #'CogMethod *'].
  	
  	blockEntryLabel := nil.
  	methodLabel dependent: nil.
  	(result := self compileEntireMethod) < 0 ifTrue:
  		[^coInterpreter cCoerceSimple: result to: #'CogMethod *'].
  	^self generateCogMethod: selector!

Item was added:
+ ----- Method: Cogit>>estimateOfAbstractOpcodesPerBytecodes (in category 'accessing') -----
+ estimateOfAbstractOpcodesPerBytecodes
+ 	<inline: true>
+ 	^ 10!

Item was added:
+ ----- Method: SistaStackToRegisterMappingCogit>>estimateOfAbstractOpcodesPerBytecodes (in category 'accessing') -----
+ estimateOfAbstractOpcodesPerBytecodes
+ 	"Due to the counter logic, the estimation is higher"
+ 	<inline: true>
+ 	self flag: 'we could fix that when #== generates less instructions'.
+ 	^ 14!



More information about the Vm-dev mailing list