mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-13 19:41:49 +00:00
typedef'd instructions
This commit is contained in:
parent
9b63005aa9
commit
0e8b29460c
File diff suppressed because it is too large
Load Diff
@ -99,6 +99,16 @@ namespace JavaScript {
|
||||
Operand3& o3() { return itsOperand3; }
|
||||
};
|
||||
|
||||
typedef Instruction_3<StringAtom*, Register, Register> GetProp;
|
||||
typedef Instruction_3<StringAtom*, Register, Register> SetProp;
|
||||
typedef Instruction_2<StringAtom*, Register> LoadName, SaveName;
|
||||
typedef Instruction_2<float64, Register> LoadImmediate;
|
||||
typedef Instruction_2<int32, Register> LoadVar, SaveVar;
|
||||
typedef Instruction_1<int32> Branch;
|
||||
typedef Instruction_2<int32, Register> BranchCond;
|
||||
typedef Instruction_3<Register, Register, Register> Arithmetic;
|
||||
typedef Instruction_2<Register, Register> Move;
|
||||
|
||||
typedef std::vector<Instruction *> InstructionStream;
|
||||
typedef InstructionStream::iterator InstructionIterator;
|
||||
|
||||
|
@ -24,15 +24,6 @@
|
||||
|
||||
namespace JavaScript {
|
||||
|
||||
// these should probably be in icodegenerator.h.
|
||||
typedef Instruction_2<StringAtom&, Register> LoadName, SaveName;
|
||||
typedef Instruction_2<float64, Register> LoadImmediate;
|
||||
typedef Instruction_2<int32, Register> LoadVar, SaveVar;
|
||||
typedef Instruction_1<int32> Branch;
|
||||
typedef Instruction_2<int32, Register> BranchCond;
|
||||
typedef Instruction_3<Register, Register, Register> Arithmetic;
|
||||
typedef Instruction_2<Register, Register> Move;
|
||||
|
||||
#define op1(i) (i->itsOperand1)
|
||||
#define op2(i) (i->itsOperand2)
|
||||
#define op3(i) (i->itsOperand3)
|
||||
@ -50,13 +41,13 @@ JSValue interpret(InstructionStream& iCode, LabelList& labels, const JSValues& a
|
||||
case LOAD_NAME:
|
||||
{
|
||||
LoadName* i = static_cast<LoadName*>(instruction);
|
||||
registers[op2(i)] = globals[op1(i)];
|
||||
registers[op2(i)] = globals[*op1(i)];
|
||||
}
|
||||
break;
|
||||
case SAVE_NAME:
|
||||
{
|
||||
SaveName* i = static_cast<SaveName*>(instruction);
|
||||
globals[op1(i)] = registers[op2(i)];
|
||||
globals[*op1(i)] = registers[op2(i)];
|
||||
}
|
||||
break;
|
||||
case LOAD_IMMEDIATE:
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -99,6 +99,16 @@ namespace JavaScript {
|
||||
Operand3& o3() { return itsOperand3; }
|
||||
};
|
||||
|
||||
typedef Instruction_3<StringAtom*, Register, Register> GetProp;
|
||||
typedef Instruction_3<StringAtom*, Register, Register> SetProp;
|
||||
typedef Instruction_2<StringAtom*, Register> LoadName, SaveName;
|
||||
typedef Instruction_2<float64, Register> LoadImmediate;
|
||||
typedef Instruction_2<int32, Register> LoadVar, SaveVar;
|
||||
typedef Instruction_1<int32> Branch;
|
||||
typedef Instruction_2<int32, Register> BranchCond;
|
||||
typedef Instruction_3<Register, Register, Register> Arithmetic;
|
||||
typedef Instruction_2<Register, Register> Move;
|
||||
|
||||
typedef std::vector<Instruction *> InstructionStream;
|
||||
typedef InstructionStream::iterator InstructionIterator;
|
||||
|
||||
|
@ -24,15 +24,6 @@
|
||||
|
||||
namespace JavaScript {
|
||||
|
||||
// these should probably be in icodegenerator.h.
|
||||
typedef Instruction_2<StringAtom&, Register> LoadName, SaveName;
|
||||
typedef Instruction_2<float64, Register> LoadImmediate;
|
||||
typedef Instruction_2<int32, Register> LoadVar, SaveVar;
|
||||
typedef Instruction_1<int32> Branch;
|
||||
typedef Instruction_2<int32, Register> BranchCond;
|
||||
typedef Instruction_3<Register, Register, Register> Arithmetic;
|
||||
typedef Instruction_2<Register, Register> Move;
|
||||
|
||||
#define op1(i) (i->itsOperand1)
|
||||
#define op2(i) (i->itsOperand2)
|
||||
#define op3(i) (i->itsOperand3)
|
||||
@ -50,13 +41,13 @@ JSValue interpret(InstructionStream& iCode, LabelList& labels, const JSValues& a
|
||||
case LOAD_NAME:
|
||||
{
|
||||
LoadName* i = static_cast<LoadName*>(instruction);
|
||||
registers[op2(i)] = globals[op1(i)];
|
||||
registers[op2(i)] = globals[*op1(i)];
|
||||
}
|
||||
break;
|
||||
case SAVE_NAME:
|
||||
{
|
||||
SaveName* i = static_cast<SaveName*>(instruction);
|
||||
globals[op1(i)] = registers[op2(i)];
|
||||
globals[*op1(i)] = registers[op2(i)];
|
||||
}
|
||||
break;
|
||||
case LOAD_IMMEDIATE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user