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

commits at source.squeak.org commits at source.squeak.org
Thu May 14 22:21:53 UTC 2015


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

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

Name: VMMaker.oscog-eem.1301
Author: eem
Time: 14 May 2015, 3:19:41.497 pm
UUID: ce7e12a9-6ef4-412e-942d-8b9d3b3b2980
Ancestors: VMMaker.oscog-eem.1300

Cogit:
Since the method zone does not scavenge PICs, the
MNU method in an MNU PIC entry cannot be young.
If it is, void the cache (load 0 instead of the method).

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

Item was changed:
  ----- Method: Cogit>>compileCPIC:Case0:Case1Method:tag:isMNUCase:numArgs: (in category 'in-line cacheing') -----
  compileCPIC: cPIC Case0: case0CogMethod Case1Method: case1Method tag: case1Tag isMNUCase: isMNUCase numArgs: numArgs
  	"Compile the code for a two-case PIC for case0CogMethod and  case1Method,case1Tag.
  	 The tag for case0CogMethod is at the send site and so doesn't need to be generated.
  	 case1Method may be any of
  		- a Cog method; jump to its unchecked entry-point
  		- a CompiledMethod; jump to the ceInterpretFromPIC trampoline
  		- nil; call ceMNUFromPIC"
  	<var: #cPIC type: #'CogMethod *'>
  	| operand targetEntry jumpNext |
  	<var: #case0CogMethod type: #'CogMethod *'>
  	<var: #targetEntry type: #'void *'>
  	<var: #jumpNext type: #'AbstractInstruction *'>
  	self assert: case1Method notNil.
  	self compilePICAbort: numArgs.
  	self assert: (objectRepresentation inlineCacheTagIsYoung: case1Tag) not.
  	(isMNUCase not
  	 and: [coInterpreter methodHasCogMethod: case1Method])
  		ifTrue:
  			[operand := 0.
  			 targetEntry := ((coInterpreter cogMethodOf: case1Method) asInteger + cmNoCheckEntryOffset) asVoidPointer]
+ 		ifFalse: "We do not scavenge PICs, hence we cannot cache the MNU method if it is in new space."
+ 			[operand := (case1Method isNil or: [objectMemory isYoungObject: case1Method])
+ 							ifTrue: [0]
+ 							ifFalse: [case1Method].
- 		ifFalse:
- 			[self assert: (case1Method isNil or: [(objectMemory isYoungObject: case1Method) not]).
- 			 operand := case1Method.
  			 targetEntry := case1Method isNil ifTrue: [picMNUAbort] ifFalse: [picInterpretAbort]].
  
  	jumpNext := self compileCPICEntry.
  	self MoveCw: 0 R: SendNumArgsReg.
  	self JumpLong: case0CogMethod asInteger + cmNoCheckEntryOffset.
  	endCPICCase0 := self CmpCw: case1Tag R: TempReg.
  	jumpNext jmpTarget: endCPICCase0.
  	self MoveCw: operand R: SendNumArgsReg.
  	self JumpLongZero: (isMNUCase ifTrue: [picMNUAbort] ifFalse: [targetEntry]) asInteger.
  	endCPICCase1 := self MoveCw: cPIC asInteger R: ClassReg.
  	self JumpLong: (self cPICMissTrampolineFor: numArgs).
  	^0
  !

Item was changed:
  ----- Method: Cogit>>compileMNUCPIC:methodOperand:numArgs: (in category 'in-line cacheing') -----
  compileMNUCPIC: cPIC methodOperand: methodOperand numArgs: numArgs
  	"Compile the code for a one-case MNU PIC that calls ceMNUFromPIC for case0Tag
  	 The tag for case0 is at the send site and so doesn't need to be generated."
  	<var: #cPIC type: #'CogMethod *'>
+ 	| jumpNext operand |
- 	| jumpNext |
  	<var: #jumpNext type: #'AbstractInstruction *'>
  	self compilePICAbort: numArgs.
  	jumpNext := self compileCPICEntry.
+ 	"We do not scavenge PICs, hence we cannot cache the MNU method if it is in new space."
+ 	operand := (methodOperand isNil or: [objectMemory isYoungObject: methodOperand])
+ 					ifTrue: [0]
+ 					ifFalse: [methodOperand].
+ 	self MoveCw: operand R: SendNumArgsReg.
- 	self MoveCw: methodOperand R: SendNumArgsReg.
  	self JumpLong: picMNUAbort asInteger.
  	jumpNext jmpTarget: (self MoveCw: cPIC asInteger R: ClassReg).
  	self JumpLong: (self cPICMissTrampolineFor: numArgs).
  	^0
  !



More information about the Vm-dev mailing list