added WITHIN, WITHOUT instructions.

git-svn-id: svn://10.0.0.236/trunk@67607 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
beard%netscape.com
2000-04-29 14:10:53 +00:00
parent b4e3633b13
commit 660beb403e
4 changed files with 94 additions and 2 deletions

View File

@@ -199,6 +199,17 @@ $ops{"RTS"} =
super => "Instruction",
rem => "Return to sender",
};
$ops{"WITHIN"} =
{
super => "Instruction_1",
rem => "within this object",
params => [ ("Register") ]
};
$ops{"WITHOUT"} =
{
super => "Instruction",
rem => "without this object",
};
#
# nasty perl code, you probably don't need to muck around below this line

View File

@@ -81,7 +81,9 @@ namespace VM {
SET_PROP, /* object, name, source */
SUBTRACT, /* dest, source1, source2 */
THROW, /* exception value */
TRY /* catch target, finally target */
TRY, /* catch target, finally target */
WITHIN, /* within this object */
WITHOUT /* without this object */
};
/********************************************************************/
@@ -124,6 +126,8 @@ namespace VM {
"SUBTRACT ",
"THROW ",
"TRY ",
"WITHIN ",
"WITHOUT ",
};
/********************************************************************/
@@ -795,6 +799,37 @@ namespace VM {
}
};
class Within : public Instruction_1<Register> {
public:
/* within this object */
Within (Register aOp1) :
Instruction_1<Register>
(WITHIN, aOp1) {};
virtual Formatter& print(Formatter& f) {
f << opcodeNames[WITHIN] << "\t" << "R" << mOp1;
return f;
}
virtual Formatter& printOperands(Formatter& f, const JSValues& registers) {
f << "R" << mOp1 << '=' << registers[mOp1];
return f;
}
};
class Without : public Instruction {
public:
/* without this object */
Without () :
Instruction
(WITHOUT) {};
virtual Formatter& print(Formatter& f) {
f << opcodeNames[WITHOUT];
return f;
}
virtual Formatter& printOperands(Formatter& f, const JSValues& /*registers*/) {
return f;
}
};
} /* namespace VM */
} /* namespace JavaScript */

View File

@@ -81,7 +81,9 @@ namespace VM {
SET_PROP, /* object, name, source */
SUBTRACT, /* dest, source1, source2 */
THROW, /* exception value */
TRY /* catch target, finally target */
TRY, /* catch target, finally target */
WITHIN, /* within this object */
WITHOUT /* without this object */
};
/********************************************************************/
@@ -124,6 +126,8 @@ namespace VM {
"SUBTRACT ",
"THROW ",
"TRY ",
"WITHIN ",
"WITHOUT ",
};
/********************************************************************/
@@ -795,6 +799,37 @@ namespace VM {
}
};
class Within : public Instruction_1<Register> {
public:
/* within this object */
Within (Register aOp1) :
Instruction_1<Register>
(WITHIN, aOp1) {};
virtual Formatter& print(Formatter& f) {
f << opcodeNames[WITHIN] << "\t" << "R" << mOp1;
return f;
}
virtual Formatter& printOperands(Formatter& f, const JSValues& registers) {
f << "R" << mOp1 << '=' << registers[mOp1];
return f;
}
};
class Without : public Instruction {
public:
/* without this object */
Without () :
Instruction
(WITHOUT) {};
virtual Formatter& print(Formatter& f) {
f << opcodeNames[WITHOUT];
return f;
}
virtual Formatter& printOperands(Formatter& f, const JSValues& /*registers*/) {
return f;
}
};
} /* namespace VM */
} /* namespace JavaScript */

View File

@@ -199,6 +199,17 @@ $ops{"RTS"} =
super => "Instruction",
rem => "Return to sender",
};
$ops{"WITHIN"} =
{
super => "Instruction_1",
rem => "within this object",
params => [ ("Register") ]
};
$ops{"WITHOUT"} =
{
super => "Instruction",
rem => "without this object",
};
#
# nasty perl code, you probably don't need to muck around below this line