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

commits at source.squeak.org commits at source.squeak.org
Fri Nov 13 20:45:03 UTC 2015


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

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

Name: VMMaker.oscog-eem.1517
Author: eem
Time: 13 November 2015, 12:43:12.972 pm
UUID: 227c3a0e-9be8-409b-ae31-2f4ddad87156
Ancestors: VMMaker.oscog-eem.1516

Eliminate some Slang generation-time warnings.

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

Item was changed:
  ----- Method: Cogit>>configureCPIC:Case0:Case1Method:tag:isMNUCase:numArgs:delta: (in category 'in-line cacheing') -----
  configureCPIC: cPIC Case0: case0CogMethod Case1Method: case1Method tag: case1Tag isMNUCase: isMNUCase numArgs: numArgs delta: addrDelta
  	"Configure a copy of the prototype CPIC 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
  	addDelta is the address change from the prototype to the new CPCI location, needed
  	because the loading of the CPIC lable at the end may use a literal instead of a pc relative"
  	<var: #cPIC type: #'CogMethod *'>
- 	| operand targetEntry caseEndAddress|
  	<var: #case0CogMethod type: #'CogMethod *'>
+ 	| operand targetEntry caseEndAddress|
  	<var: #targetEntry type: #'void *'>
- 	<var: #jumpNext type: #'AbstractInstruction *'>
  	self assert: case1Method notNil.
  
  	"adjust the jump at missOffset, the ceAbortXArgs"
  	backEnd rewriteJumpLongAt: cPIC asInteger + missOffset target: (self picAbortTrampolineFor: 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].
  			 targetEntry := case1Method isNil ifTrue: [cPIC asInteger + (self sizeof: CogMethod)] ifFalse: [cPIC asInteger + self picInterpretAbortOffset]].
  
  	"set the jump to the case0 method"
  	backEnd rewriteJumpLongAt: cPIC asInteger + firstCPICCaseOffset target: case0CogMethod asInteger + cmNoCheckEntryOffset.
  
  	caseEndAddress := self addressOfEndOfCase: 2 inCPIC: cPIC.
  
  	"update the cpic case - deferred to backend because messy"
  	backEnd rewriteCPICCaseAt: caseEndAddress tag: case1Tag objRef: operand target: (isMNUCase ifTrue: [cPIC asInteger + (self sizeof: CogMethod)] ifFalse: [targetEntry]) asInteger.
  
  	"update the loading of the PCIC label address"
  	backEnd relocateMethodReferenceBeforeAddress: cPIC asInteger + cPICEndOfCodeOffset - backEnd jumpLongByteSize by: addrDelta.
  
  	"write the final desperate jump to cePICMissXArgs"
  	backEnd rewriteJumpLongAt: cPIC asInteger + cPICEndOfCodeOffset target: (self cPICMissTrampolineFor: numArgs).
  	^0
  	"self disassembleFrom: cPIC + (self sizeof: CogMethod) to: cPIC + closedPICSize - 1."!

Item was changed:
  ----- Method: Cogit>>configureMNUCPIC:methodOperand:numArgs:delta: (in category 'in-line cacheing') -----
  configureMNUCPIC: cPIC methodOperand: methodOperand numArgs: numArgs delta: addrDelta
  	"Configure a copy of the prototype CPIC 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.
  	addDelta is the address change from the prototype to the new CPCI location, needed
  	because the loading of the CPIC label at the end may use a literal instead of a pc relative"
  	<var: #cPIC type: #'CogMethod *'>
  	| operand |
- 	<var: #jumpNext type: #'AbstractInstruction *'>
  
  	"adjust the jump at missOffset, the ceAbortXArgs"
  	backEnd rewriteJumpLongAt: cPIC asInteger + missOffset target: (self picAbortTrampolineFor: numArgs).
  	
  	"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].
  	"set the jump to the case0 method"
  	backEnd rewriteJumpLongAt: cPIC asInteger + firstCPICCaseOffset target: cPIC asInteger + (self sizeof: CogMethod) .
  
  	backEnd storeLiteral: operand beforeFollowingAddress: cPIC asInteger + firstCPICCaseOffset - backEnd jumpLongByteSize.
  
  	"rewrite the final desperate jump to cePICMissXArgs"
  	backEnd rewriteJumpLongAt: cPIC asInteger + cPICEndOfCodeOffset target: (self cPICMissTrampolineFor: numArgs).	
  
  	"update the loading of the PCIC label address"
  	backEnd relocateMethodReferenceBeforeAddress: cPIC asInteger + cPICEndOfCodeOffset - backEnd jumpLongByteSize by: addrDelta.
  
  	"finally, rewrite the jump 3 instr  before firstCPICCaseOffset to jump to the end of case 2, missing the actual case"
  	self rewriteCPIC: cPIC caseJumpTo: (self addressOfEndOfCase: 2 inCPIC: cPIC). 
  
  
  	^0
  !

Item was changed:
  ----- Method: Cogit>>getCFramePointer (in category 'accessing') -----
  getCFramePointer
  	<api>
  	<cmacro: '() CFramePointer'>
  	"and in the simulator we use..."
  	^(backEnd wantsNearAddressFor: #CFramePointer)
  		ifTrue: [CFramePointer]
+ 		ifFalse: [(objectMemory longAt: coInterpreter inMemoryCFramePointerAddress) asVoidPointer]!
- 		ifFalse: [objectMemory longAt: coInterpreter inMemoryCFramePointerAddress]!

Item was changed:
  ----- Method: Cogit>>getCStackPointer (in category 'accessing') -----
  getCStackPointer
  	<api>
  	<cmacro: '() CStackPointer'>
  	"and in the simulator we use..."
  	^(backEnd wantsNearAddressFor: #CStackPointer)
  		ifTrue: [CStackPointer]
+ 		ifFalse: [(objectMemory longAt: coInterpreter inMemoryCStackPointerAddress) asVoidPointer]!
- 		ifFalse: [objectMemory longAt: coInterpreter inMemoryCStackPointerAddress]!

Item was changed:
  ----- Method: Cogit>>setCFramePointer: (in category 'accessing') -----
  setCFramePointer: aFramePointer
  	<api>
  	<cmacro: '(theFP) (CFramePointer = (void *)(theFP))'>
  	"and in the simulator we use..."
  	^(backEnd wantsNearAddressFor: #CFramePointer)
  		ifTrue: [CFramePointer := aFramePointer]
+ 		ifFalse: [(objectMemory
- 		ifFalse: [objectMemory
  					longAt: coInterpreter inMemoryCFramePointerAddress
+ 					put: aFramePointer) asVoidPointer]!
- 					put: aFramePointer]!

Item was changed:
  ----- Method: Cogit>>setCStackPointer: (in category 'accessing') -----
  setCStackPointer: aStackPointer
  	<api>
  	<cmacro: '(theSP) (CStackPointer = (void *)(theSP))'>
  	"and in the simulator we use..."
  	^(backEnd wantsNearAddressFor: #CStackPointer)
  		ifTrue: [CStackPointer := aStackPointer]
+ 		ifFalse: [(objectMemory
- 		ifFalse: [objectMemory
  					longAt: coInterpreter inMemoryCStackPointerAddress
+ 					put: aStackPointer) asVoidPointer]!
- 					put: aStackPointer]!



More information about the Vm-dev mailing list