-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved #moveFramesIn:through:toPage: method to the super class and add…
…ed hook methods to specialize in the subclasses (#defaultCallerSavedIP, #getCallerIPFromFP:callerFP:). Moved #genPushRegisterArgsForAbortMissNumArgs: to the new super class CogX86Compiler. Moved #changeClassOf:to: method to the super class and rewrote it in terms of the word size. Added a new test class VMPrimitiveChangeClassParametrizedTest
- Loading branch information
1 parent
bf4e091
commit daf4e3a
Showing
9 changed files
with
261 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
Class { | ||
#name : 'CogX86Compiler', | ||
#superclass : 'CogAbstractInstruction', | ||
#category : 'VMMaker-JIT', | ||
#package : 'VMMaker', | ||
#tag : 'JIT' | ||
} | ||
|
||
{ #category : 'smalltalk calling convention' } | ||
CogX86Compiler >> genPushRegisterArgsForAbortMissNumArgs: numArgs [ | ||
"Ensure that the register args are pushed before the outer and | ||
inner retpcs at an entry miss for arity <= self numRegArgs. The | ||
outer retpc is that of a call at a send site. The inner is the call | ||
from a method or PIC abort/miss to the trampoline." | ||
|
||
"This won't be as clumsy on a RISC. But putting the receiver and | ||
args above the return address means the CoInterpreter has a | ||
single machine-code frame format which saves us a lot of work." | ||
|
||
"Iff there are register args convert | ||
base -> outerRetpc (send site retpc) | ||
sp -> innerRetpc (PIC abort/miss retpc) | ||
to | ||
base -> receiver | ||
(arg0) | ||
(arg1) | ||
outerRetpc | ||
sp -> innerRetpc (PIC abort/miss retpc)" | ||
numArgs <= cogit numRegArgs ifTrue: | ||
[self assert: cogit numRegArgs <= 2. | ||
numArgs = 0 ifTrue: | ||
[cogit MoveMw: 0 r: SPReg R: TempReg. | ||
cogit PushR: TempReg. | ||
cogit MoveMw: objectMemory wordSize * 2 r: SPReg R: TempReg. | ||
cogit MoveR: TempReg Mw: objectMemory wordSize r: SPReg. | ||
cogit MoveR: ReceiverResultReg Mw: 2 * objectMemory wordSize r: SPReg. | ||
^self]. | ||
numArgs = 1 ifTrue: | ||
[cogit MoveMw: objectMemory wordSize r: SPReg R: TempReg. | ||
cogit PushR: TempReg. | ||
cogit MoveMw: objectMemory wordSize r: SPReg R: TempReg. | ||
cogit PushR: TempReg. | ||
cogit MoveR: ReceiverResultReg Mw: 3 * objectMemory wordSize r: SPReg. | ||
cogit MoveR: Arg0Reg Mw: 2 * objectMemory wordSize r: SPReg. | ||
^self]. | ||
numArgs = 2 ifTrue: | ||
[cogit PushR: Arg1Reg. | ||
cogit MoveMw: objectMemory wordSize * 2 r: SPReg R: TempReg. | ||
cogit PushR: TempReg. | ||
cogit MoveMw: objectMemory wordSize * 2 r: SPReg R: TempReg. | ||
cogit PushR: TempReg. | ||
cogit MoveR: ReceiverResultReg Mw: 4 * objectMemory wordSize r: SPReg. | ||
cogit MoveR: Arg0Reg Mw: 3 * objectMemory wordSize r: SPReg. | ||
^self]] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.