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

commits at source.squeak.org commits at source.squeak.org
Tue Dec 17 20:14:02 UTC 2019

Eliot Miranda uploaded a new version of VMMaker to project VM Maker:

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

Name: VMMaker.oscog-eem.2617
Author: eem
Time: 17 December 2019, 12:13:41.934421 pm
UUID: 88a9d8d6-9b66-4013-8660-c87ad8a4caa7
Ancestors: VMMaker.oscog-eem.2616

Whoops! The send trampolines must save & restore the link register around the selectorIndexDereferenceRoutine if on a 64-bit RISC.

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

Item was changed:
  ----- Method: StackToRegisterMappingCogit>>genSendTrampolineFor:numArgs:called:arg:arg:arg:arg: (in category 'initialization') -----
  genSendTrampolineFor: aRoutine numArgs: numArgs called: aString arg: regOrConst0 arg: regOrConst1 arg: regOrConst2 arg: regOrConst3
  	"Generate a trampoline with four arguments.
  	 Hack: a negative value indicates an abstract register, a non-negative value indicates a constant."
  	<var: #aRoutine type: #'void *'>
  	<var: #aString type: #'char *'>
  	| startAddress |
  	<inline: false>
  	startAddress := methodZoneBase.
  	self zeroOpcodeIndex.
  	backEnd genPushRegisterArgsForNumArgs: numArgs scratchReg: SendNumArgsReg.
+ 	"If we're on a 64-bit platform we use 32-bit inline caches.  These don't have room for a selector oop, only
+ 	 a selector index.  If so, call the selectorIndexDereferenceRoutine to convert the index into a selector oop."
  	objectRepresentation selectorIndexDereferenceRoutine ifNotNil:
+ 		[:routine| "Explicitly save LinkReg via ExtraReg2; it's presumably faster than pushing/popping"
+ 		 backEnd hasLinkRegister ifTrue: [self MoveR: LinkReg R: Extra2Reg].
+ 		 self Call: routine.
+ 		 backEnd hasLinkRegister ifTrue: [self MoveR: Extra2Reg R: LinkReg]].
- 		[:routine| self Call: routine].
  	self genTrampolineFor: aRoutine
  		called: aString
  		numArgs: 4
  		arg: regOrConst0
  		arg: regOrConst1
  		arg: regOrConst2
  		arg: regOrConst3
  		regsToSave: self emptyRegisterMask
  		pushLinkReg: true
  		resultReg: NoReg
  		appendOpcodes: true.

More information about the Vm-dev mailing list