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

commits at source.squeak.org commits at source.squeak.org
Wed Mar 18 00:53:18 UTC 2015


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

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

Name: VMMaker.oscog-eem.1095
Author: eem
Time: 17 March 2015, 5:50:59.242 pm
UUID: 87e54293-385c-427c-8c96-3d8b934aa808
Ancestors: VMMaker.oscog-eem.1094

On ARM the ceTraceLinkedSend call needs to
posh/pop the LinkReg around the call.

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

Item was changed:
  ----- Method: Cogit>>compileEntry (in category 'compile abstract instructions') -----
  compileEntry
  	"The entry code to a method checks that the class of the current receiver matches
  	 that in the inline cache.  Other non-obvious elements are that its alignment must be
  	 different from the alignment of the noCheckEntry so that the method map machinery
  	 can distinguish normal and super sends (super sends bind to the noCheckEntry).
  	 In Newspeak we also need to distinguish dynSuperSends from normal and super
  	 and so on Nespeak, bind the dynSuperEntry to the preceeding nop (on x86 there
  	 happens to be one anyway)."
  
  	self cppIf: NewspeakVM ifTrue:
  		[self Nop. "1st nop differentiates dynSuperEntry from no-check entry if using nextMethod"
  		 dynSuperEntry := self Nop].
  	entry := objectRepresentation genGetInlineCacheClassTagFrom: ReceiverResultReg into: TempReg forEntry: true.
  	self CmpR: ClassReg R: TempReg.
  	self JumpNonZero: sendMiss.
  	noCheckEntry := self Label.
  	self compileSendTrace ifTrue:
+ 		[backEnd hasLinkRegister ifTrue:
+ 			[self PushR: LinkReg].
+ 		 self CallRT: ceTraceLinkedSendTrampoline.
+ 		 backEnd hasLinkRegister ifTrue:
+ 			[self PopR: LinkReg]]!
- 		[self CallRT: ceTraceLinkedSendTrampoline]!

Item was changed:
  ----- Method: Cogit>>computeEntryOffsets (in category 'initialization') -----
  computeEntryOffsets
  	"Generate the entry code for a method to determine cmEntryOffset and cmNoCheckEntryOffset.  We
  	 need cmNoCheckEntryOffset up front to be able to generate the map starting from cmNoCheckEntryOffset"
  	"stack allocate the various collections so that they
  	 are effectively garbage collected on return."
  	| sendMissCall |
  	<var: 'sendMissCall' type: #'AbstractInstruction *'>
+ 	self allocateOpcodes: 24 bytecodes: 0.
- 	self allocateOpcodes: 20 bytecodes: 0.
  	methodOrBlockNumArgs := 0.
  	sendMissCall := self compileAbort.
  	self compileEntry.
  	self computeMaximumSizes.
  	self generateInstructionsAt: methodZoneBase + (self sizeof: CogMethod).
  	cmEntryOffset := entry address - methodZoneBase.
  	cmNoCheckEntryOffset := noCheckEntry address - methodZoneBase.
  	self cppIf: NewspeakVM
  		ifTrue: [cmDynSuperEntryOffset := dynSuperEntry address - methodZoneBase].
  	missOffset := sendMissCall address + sendMissCall machineCodeSize - methodZoneBase.
  	entryPointMask := objectMemory wordSize - 1.
  	[self cppIf: NewspeakVM
  		ifTrue: [(cmEntryOffset bitAnd: entryPointMask) = (cmNoCheckEntryOffset bitAnd: entryPointMask)
  				or: [(cmEntryOffset bitAnd: entryPointMask) = (cmDynSuperEntryOffset bitAnd: entryPointMask)
  				or: [(cmNoCheckEntryOffset bitAnd: entryPointMask) = (cmDynSuperEntryOffset bitAnd: entryPointMask)]]]
  		ifFalse: [(cmEntryOffset bitAnd: entryPointMask) = (cmNoCheckEntryOffset bitAnd: entryPointMask)]] whileTrue:
  		[entryPointMask := entryPointMask + entryPointMask + 1].
  	entryPointMask >= (methodZone roundUpLength: 1) ifTrue:
  		[self error: 'cannot differentiate checked and unchecked entry-points with current cog method alignment'].
  	checkedEntryAlignment := cmEntryOffset bitAnd: entryPointMask.
  	uncheckedEntryAlignment := cmNoCheckEntryOffset bitAnd: entryPointMask.
  	self assert: checkedEntryAlignment ~= uncheckedEntryAlignment.
  	self cppIf: NewspeakVM
  		ifTrue:
  			[cmDynSuperEntryOffset := dynSuperEntry address - methodZoneBase.
  			 dynSuperEntryAlignment := cmDynSuperEntryOffset bitAnd: entryPointMask.
  			self assert: dynSuperEntryAlignment ~= checkedEntryAlignment.
  			self assert: dynSuperEntryAlignment ~= uncheckedEntryAlignment]!



More information about the Vm-dev mailing list