|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectdspl.backend.x86.X86VariableManager
public class X86VariableManager
X86VariableManager is responsible for providing registers to store Variables when necessary.
| Field Summary | |
|---|---|
private AssemblyfileGenerator |
afg
AssemblyFileGenerator for the current program Used to write additional move instructions that may be required when providing registers |
private static X86Register |
eaxReg
|
private static X86Register |
ebxReg
|
private static X86Register |
ecxReg
|
private static X86Register |
ediReg
|
private static X86Register |
edxReg
|
private static X86Register |
esiReg
|
(package private) int |
GENERAL_REGISTER_EAX
|
(package private) int |
GENERAL_REGISTER_EBP
|
(package private) int |
GENERAL_REGISTER_EBX
|
(package private) int |
GENERAL_REGISTER_ECX
|
(package private) int |
GENERAL_REGISTER_EDI
|
(package private) int |
GENERAL_REGISTER_EDX
|
(package private) int |
GENERAL_REGISTER_ESI
|
(package private) int |
GENERAL_REGISTER_ESP
|
private static java.lang.String[] |
registerStrings
|
private Variable[] |
registerValues
|
private SymbolTable |
st
Stores the SymbolTable for the program |
private static java.lang.String |
ST_TEMP_POSTFIX
Postfix applied to each register's name to form the ID for the Variable used to temporarily store the value of a register in memory |
private static X86Register |
xmm0Reg
|
private static X86Register |
xmm1Reg
|
private static X86Register |
xmm2Reg
|
private static X86Register |
xmm3Reg
|
| Constructor Summary | |
|---|---|
X86VariableManager(SymbolTable st,
AssemblyfileGenerator afg)
|
|
| Method Summary | |
|---|---|
static X86Register |
getEax()
|
static X86Register |
getEbx()
|
static X86Register |
getEcx()
|
static X86Register |
getEdi()
|
static X86Register |
getEdx()
|
static X86Register |
getEsi()
|
static X86Register |
getFreeRegister()
|
static void |
getRegister()
|
static void |
getRegister(int registerNum)
|
static void |
getVarInRegister(Variable v)
|
static X86Register |
getXmm0()
|
static X86Register |
getXmm1()
|
static X86Register |
getXmm3()
|
static X86Operand |
prepareArg1Variable(Variable var,
int allowableOpTypes,
AssemblyfileGenerator afg)
Very important note: Arg1, when retrieved in memory, is stored in eax. |
static X86Operand |
prepareArg2Variable(Variable var,
int allowableOpTypes,
AssemblyfileGenerator afg)
Very important note: see note above, same holds for ecx |
static X86Register |
prepareArrayLocAsReg(Variable var,
X86Register reg,
AssemblyfileGenerator afg)
intended specifically when given an array ("iA", for example), do: mov $iA, %(specified reg) and return the specified reg |
static X86Operand |
prepareDestVariable(Variable var,
int allowableOpTypes,
AssemblyfileGenerator afg)
|
static X86Register |
prepareRegVariableWithExplicitMove(Variable var,
java.lang.String explicitMovInstruction,
AssemblyfileGenerator afg)
Used when the exact mov instruction for putting the variable into a register is known Added for type conversions Always retuns reg in %eax NOTE: here the register content's lenght IS NOT SET, this must be done after calling the function to get the desired moves for conversion (since length is based on the destination not the src which is the var we have here) |
static X86Operand |
prepareVariable(Variable var,
X86Register indexRegister,
X86Register variableRegister,
int allowableOpTypes,
AssemblyfileGenerator afg)
|
static void |
pushFloatingPointVariable(Variable var,
AssemblyfileGenerator afg)
Pushes the floating point variable onto the FPU stack (@ ST(0)); |
static void |
writeFPLoad(Variable var,
X86Operand op,
AssemblyfileGenerator afg)
Pushes op (which represents var) onto the stack |
static void |
writeMoveInstruction(X86Operand src,
X86Operand dest,
AssemblyfileGenerator afg)
|
static void |
writeTopOfFPStack(Variable var,
AssemblyfileGenerator afg)
|
static void |
writeVectorMoveInstruction(X86Operand src,
X86Operand dest,
AssemblyfileGenerator afg,
boolean isAligned)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
int GENERAL_REGISTER_EAX
int GENERAL_REGISTER_EBX
int GENERAL_REGISTER_ECX
int GENERAL_REGISTER_EDX
int GENERAL_REGISTER_EDI
int GENERAL_REGISTER_ESI
int GENERAL_REGISTER_ESP
int GENERAL_REGISTER_EBP
private static X86Register eaxReg
private static X86Register ebxReg
private static X86Register ecxReg
private static X86Register edxReg
private static X86Register ediReg
private static X86Register esiReg
private static X86Register xmm0Reg
private static X86Register xmm1Reg
private static X86Register xmm2Reg
private static X86Register xmm3Reg
private static final java.lang.String[] registerStrings
private Variable[] registerValues
private static final java.lang.String ST_TEMP_POSTFIX
private SymbolTable st
private AssemblyfileGenerator afg
| Constructor Detail |
|---|
public X86VariableManager(SymbolTable st,
AssemblyfileGenerator afg)
throws SymbolicException
SymbolicException| Method Detail |
|---|
public static X86Register getEax()
public static X86Register getEbx()
public static X86Register getEcx()
public static X86Register getEdx()
public static X86Register getEdi()
public static X86Register getEsi()
public static X86Register getXmm0()
public static X86Register getXmm1()
public static X86Register getXmm3()
public static void getVarInRegister(Variable v)
public static void getRegister()
public static X86Register getFreeRegister()
public static void getRegister(int registerNum)
public static void writeMoveInstruction(X86Operand src,
X86Operand dest,
AssemblyfileGenerator afg)
public static void writeVectorMoveInstruction(X86Operand src,
X86Operand dest,
AssemblyfileGenerator afg,
boolean isAligned)
public static X86Operand prepareArg1Variable(Variable var,
int allowableOpTypes,
AssemblyfileGenerator afg)
public static X86Operand prepareArg2Variable(Variable var,
int allowableOpTypes,
AssemblyfileGenerator afg)
var - allowableOpTypes - afg -
public static X86Operand prepareDestVariable(Variable var,
int allowableOpTypes,
AssemblyfileGenerator afg)
public static X86Register prepareArrayLocAsReg(Variable var,
X86Register reg,
AssemblyfileGenerator afg)
var - afg -
public static X86Operand prepareVariable(Variable var,
X86Register indexRegister,
X86Register variableRegister,
int allowableOpTypes,
AssemblyfileGenerator afg)
public static X86Register prepareRegVariableWithExplicitMove(Variable var,
java.lang.String explicitMovInstruction,
AssemblyfileGenerator afg)
var - explicitMovInstruction - afg -
public static void pushFloatingPointVariable(Variable var,
AssemblyfileGenerator afg)
var - indexRegister - variableRegister - allowableOpTypes - afg -
public static void writeFPLoad(Variable var,
X86Operand op,
AssemblyfileGenerator afg)
var - op -
public static void writeTopOfFPStack(Variable var,
AssemblyfileGenerator afg)
var - the destination variable to write toafg -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||