VM Maker: VMMaker.oscog-eem.2617.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VM Maker: VMMaker.oscog-eem.2617.mcz

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

==================== 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.
  ^startAddress!