|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jikesrvm.compilers.opt.ir.IRTools
org.jikesrvm.compilers.opt.regalloc.ia32.CallingConvention
public abstract class CallingConvention
This class contains IA32 calling conventions The two public methods are: (1) expandCallingConventions(IR) which is called by the register allocator immediately before allocation to make manifest the use of registers by the calling convention. (2) expandSysCall(Instruction, IR) which is called to expand a SYSCALL HIR instruction into the appropriate sequence of LIR instructions. TODO: Much of this code could still be factored out as architecture-independent.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.jikesrvm.ia32.RegisterConstants |
|---|
RegisterConstants.FloatingPointMachineRegister, RegisterConstants.FPR, RegisterConstants.GPR, RegisterConstants.MachineRegister, RegisterConstants.MM, RegisterConstants.XMM |
| Field Summary | |
|---|---|
private static int |
WORDSIZE
Size of a word, in bytes |
| Fields inherited from interface org.jikesrvm.compilers.opt.regalloc.ia32.PhysicalRegisterConstants |
|---|
AF, C0, C1, C2, C3, CF, CONDITION_VALUE, DOUBLE_REG, DOUBLE_VALUE, FIRST_DOUBLE, FIRST_INT, FIRST_SPECIAL, FLOAT_VALUE, INT_REG, INT_VALUE, NUM_SPECIALS, NUMBER_TYPE, OF, PF, SF, SPECIAL_REG, ST0, ST1, ZF |
| Fields inherited from interface org.jikesrvm.ia32.RegisterConstants |
|---|
ALL_FPRS, ALL_GPRS, EAX, EBP, EBX, ECX, EDI, EDX, ESI, ESP, FP0, FP1, FP2, FP3, FP4, FP5, FP6, FP7, INSTRUCTION_WIDTH, LG_INSTRUCTION_WIDTH, MM0, MM1, MM10, MM11, MM12, MM13, MM14, MM15, MM2, MM3, MM4, MM5, MM6, MM7, MM8, MM9, NATIVE_NONVOLATILE_FPRS, NATIVE_NONVOLATILE_GPRS, NATIVE_PARAMETER_FPRS, NATIVE_PARAMETER_GPRS, NATIVE_VOLATILE_FPRS, NATIVE_VOLATILE_GPRS, NONVOLATILE_FPRS, NONVOLATILE_GPRS, NUM_FPRS, NUM_GPRS, NUM_NONVOLATILE_FPRS, NUM_NONVOLATILE_GPRS, NUM_PARAMETER_FPRS, NUM_PARAMETER_GPRS, NUM_RETURN_FPRS, NUM_RETURN_GPRS, NUM_VOLATILE_FPRS, NUM_VOLATILE_GPRS, PARAMETER_FPRS, PARAMETER_GPRS, R0, R1, R10, R11, R12, R13, R14, R15, R2, R3, R4, R5, R6, R7, R8, R9, RETURN_FPRS, RETURN_GPRS, STACK_POINTER, THREAD_REGISTER, VOLATILE_FPRS, VOLATILE_GPRS, XMM0, XMM1, XMM10, XMM11, XMM12, XMM13, XMM14, XMM15, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7, XMM8, XMM9 |
| Constructor Summary | |
|---|---|
CallingConvention()
|
|
| Method Summary | |
|---|---|
static void |
allocateSpaceForSysCall(IR ir)
We have to save/restore the non-volatile registers around syscalls, to protect ourselves from malicious C compilers and Linux kernels. |
private static void |
callExpand(Instruction call,
IR ir)
Expand the calling convention for a particular call instruction |
private static int |
countFPRParams(Instruction call)
Count the number of FPR parameters in a call instruction. |
private static int |
countFPRParamsInPrologue(Instruction p)
Count the number of FPR parameters in a prologue instruction. |
static void |
expandCallingConventions(IR ir)
Expand calling conventions to make physical registers explicit in the IR when required for calls, returns, and the prologue. |
private static int |
expandParametersToCall(Instruction call,
IR ir)
Explicitly copy parameters to a call into the appropriate physical registers as defined by the calling convention. |
private static int |
expandParametersToSysCall(Instruction call,
IR ir)
Explicitly copy parameters to a system call into the appropriate physical registers as defined by the calling convention. |
private static void |
expandPrologue(IR ir)
Expand the prologue instruction. |
private static void |
expandResultOfCall(Instruction call,
boolean isSysCall,
IR ir)
Explicitly copy the result of a call instruction from the result register to the appropriate symbolic register, as defined by the calling convention. |
static void |
expandSysCall(Instruction s,
IR ir)
Calling convention to implement calls to native (C) routines using the Linux linkage conventions. |
(package private) static void |
restoreNonvolatilesAfterSysCall(Instruction call,
IR ir)
Restore all nonvolatile registers after a syscall. |
private static void |
returnExpand(Instruction ret,
IR ir)
Expand the calling convention for a particular return instruction |
static void |
saveNonvolatilesAroundSysCall(Instruction call,
IR ir)
Save and restore all nonvolatile registers around a syscall. |
(package private) static void |
saveNonvolatilesBeforeSysCall(Instruction call,
IR ir)
Save all nonvolatile registers before a syscall. |
| Methods inherited from class org.jikesrvm.compilers.opt.ir.IRTools |
|---|
A, AC, AC, CPOS, CR, D, DC, defDoublesAsUse, definedIn, F, FC, getCondMoveOp, getDefaultOperand, getLoadOp, getLoadOp, getMoveOp, getStoreOp, getStoreOp, I, IC, insertInstructionsAfter, L, LC, makeBlockOnEdge, mayBeVolatileFieldLoad, moveInstruction, moveIntoRegister, moveIntoRegister, nonPEIGC, TG, usedIn, useDoublesAsDef |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final int WORDSIZE
| Constructor Detail |
|---|
public CallingConvention()
| Method Detail |
|---|
public static void expandCallingConventions(IR ir)
private static void callExpand(Instruction call,
IR ir)
private static void returnExpand(Instruction ret,
IR ir)
private static void expandResultOfCall(Instruction call,
boolean isSysCall,
IR ir)
private static int expandParametersToCall(Instruction call,
IR ir)
public static void saveNonvolatilesAroundSysCall(Instruction call,
IR ir)
call - the sys call
static void saveNonvolatilesBeforeSysCall(Instruction call,
IR ir)
call - the sys call
static void restoreNonvolatilesAfterSysCall(Instruction call,
IR ir)
call - the sys call
private static int expandParametersToSysCall(Instruction call,
IR ir)
public static void allocateSpaceForSysCall(IR ir)
public static void expandSysCall(Instruction s,
IR ir)
private static int countFPRParams(Instruction call)
private static int countFPRParamsInPrologue(Instruction p)
private static void expandPrologue(IR ir)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||