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

commits at source.squeak.org commits at source.squeak.org
Mon Apr 20 01:33:17 UTC 2015


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

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

Name: VMMaker.oscog-eem.1224
Author: eem
Time: 19 April 2015, 6:31:17.879 pm
UUID: 95771251-df5c-42c0-9d62-a7a26d0c5646
Ancestors: VMMaker.oscog-eem.1223

Implement CogARMCompiler>>relocateCallBeforeReturnPC:by:
given the new simple intra-zone calls and jumps.

Rename relocateJumpBeforeFollowingAddress:by: to
relocateJumpLongBeforeFollowingAddress:by: to
reflect our more accurate terminology.

So now ARM stops in code compaction when trying
to relocateMethodReferenceBeforeAddress:by:.
Currently the method literal is synthesized using the
4 instruction sequence, and so the relocation could
use an adapted rewriteCallFull:.  But much better is to
use pc-relative addressing to produce the method
literal, which would result in a null
relocateMethodReferenceBeforeAddress:by:.

So make no attempt to implement
relocateMethodReferenceBeforeAddress:by:.

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

Item was added:
+ ----- Method: CogARMCompiler>>relocateCallBeforeReturnPC:by: (in category 'inline cacheing') -----
+ relocateCallBeforeReturnPC: retpc by: delta
+ 	| instr distanceDiv4 |
+ 	self assert: delta \\ 4 = 0.
+ 	delta ~= 0 ifTrue:
+ 		[instr := objectMemory longAt: retpc - 4.
+ 		 distanceDiv4 := instr bitAnd: 16rFFFFFF.
+ 		 distanceDiv4 := distanceDiv4 + (delta // 4).
+ 		 objectMemory longAt: retpc - 4 put: ((instr bitAnd: 16rFF000000) bitOr: (delta bitAnd: 16rFFFFFF))]!

Item was removed:
- ----- Method: CogAbstractInstruction>>relocateJumpBeforeFollowingAddress:by: (in category 'inline cacheing') -----
- relocateJumpBeforeFollowingAddress: pc by: delta
- 	^self subclassResponsibility!

Item was added:
+ ----- Method: CogAbstractInstruction>>relocateJumpLongBeforeFollowingAddress:by: (in category 'inline cacheing') -----
+ relocateJumpLongBeforeFollowingAddress: pc by: delta
+ 	"We assume here that calls and jumps look the same as regards their displacement.
+ 	 This works on at least x86, ARM and x86_64.  Processors on which that isn't the
+ 	 case can override as necessary."
+ 	self relocateCallBeforeReturnPC: pc by: delta!

Item was removed:
- ----- Method: CogIA32Compiler>>relocateJumpBeforeFollowingAddress:by: (in category 'inline cacheing') -----
- relocateJumpBeforeFollowingAddress: pc by: delta
- 	self relocateCallBeforeReturnPC: pc by: delta!

Item was changed:
  ----- Method: Cogit>>relocateCallsInClosedPIC: (in category 'compaction') -----
  relocateCallsInClosedPIC: cPIC
  	<var: #cPIC type: #'CogMethod *'>
  	| delta pc entryPoint targetMethod |
  	<var: #targetMethod type: #'CogMethod *'>
  	delta := cPIC objectHeader.
  	self assert: (backEnd callTargetFromReturnAddress: cPIC asInteger + missOffset)
  					= (self picAbortTrampolineFor: cPIC cmNumArgs).
  	backEnd relocateCallBeforeReturnPC: cPIC asInteger + missOffset by: delta negated.
  
  	pc := cPIC asInteger + firstCPICCaseOffset.
  	1 to: cPIC cPICNumCases do:
  		[:i|
  		entryPoint := backEnd jumpLongTargetBeforeFollowingAddress: pc.
  		"Find target from jump.  Ignore jumps to the interpret and MNU calls within this PIC"
  		(entryPoint < cPIC asInteger
  		 or: [entryPoint > (cPIC asInteger + cPIC blockSize)]) ifTrue:
  			[targetMethod := self cCoerceSimple: entryPoint - cmNoCheckEntryOffset to: #'CogMethod *'.
  			 self assert: targetMethod cmType = CMMethod.
  			 backEnd
+ 				relocateJumpLongBeforeFollowingAddress: pc
- 				relocateJumpBeforeFollowingAddress: pc
  				by: (delta - targetMethod objectHeader) negated].
  		pc := pc + cPICCaseSize].
  	self assert: cPIC cPICNumCases > 0.
  	pc := pc - cPICCaseSize.
  	"Finally relocate the load of the PIC and the jump to the overflow routine ceCPICMiss:receiver:"
  	backEnd relocateMethodReferenceBeforeAddress: pc + backEnd loadLiteralByteSize by: delta.
  	backEnd relocateJumpBeforeFollowingAddress: pc + cPICEndSize by: delta negated!



More information about the Vm-dev mailing list