From 660beb403e2f963e336093333b41fcc50131046e Mon Sep 17 00:00:00 2001 From: "beard%netscape.com" Date: Sat, 29 Apr 2000 14:10:53 +0000 Subject: [PATCH] added WITHIN, WITHOUT instructions. git-svn-id: svn://10.0.0.236/trunk@67607 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/js/js2/tools/gencode.pl | 11 ++++++++++ mozilla/js/js2/vmtypes.h | 37 ++++++++++++++++++++++++++++++++- mozilla/js2/src/vmtypes.h | 37 ++++++++++++++++++++++++++++++++- mozilla/js2/tools/gencode.pl | 11 ++++++++++ 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/mozilla/js/js2/tools/gencode.pl b/mozilla/js/js2/tools/gencode.pl index 0ead8949795..0407fc16c3a 100644 --- a/mozilla/js/js2/tools/gencode.pl +++ b/mozilla/js/js2/tools/gencode.pl @@ -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 diff --git a/mozilla/js/js2/vmtypes.h b/mozilla/js/js2/vmtypes.h index fca0ccc13a2..97cc9bc6d04 100644 --- a/mozilla/js/js2/vmtypes.h +++ b/mozilla/js/js2/vmtypes.h @@ -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 { + public: + /* within this object */ + Within (Register aOp1) : + Instruction_1 + (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 */ diff --git a/mozilla/js2/src/vmtypes.h b/mozilla/js2/src/vmtypes.h index fca0ccc13a2..97cc9bc6d04 100644 --- a/mozilla/js2/src/vmtypes.h +++ b/mozilla/js2/src/vmtypes.h @@ -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 { + public: + /* within this object */ + Within (Register aOp1) : + Instruction_1 + (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 */ diff --git a/mozilla/js2/tools/gencode.pl b/mozilla/js2/tools/gencode.pl index 0ead8949795..0407fc16c3a 100644 --- a/mozilla/js2/tools/gencode.pl +++ b/mozilla/js2/tools/gencode.pl @@ -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