typedef'd instructions

This commit is contained in:
rogerl%netscape.com 2000-04-05 23:41:58 +00:00
parent 9b63005aa9
commit 0e8b29460c
6 changed files with 1020 additions and 1028 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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;

View File

@ -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

View File

@ -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;

View File

@ -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: