LoadString now has JSString* as second operand

This commit is contained in:
beard%netscape.com 2000-05-09 05:38:48 +00:00
parent 6f85ea39ec
commit 1c816f64a6
8 changed files with 16 additions and 14 deletions

View File

@ -149,7 +149,7 @@ namespace ICG {
Register ICodeGenerator::loadString(String &value)
{
Register dest = getRegister();
LoadString *instr = new LoadString(dest, &value);
LoadString *instr = new LoadString(dest, new JSString(value));
iCode->push_back(instr);
return dest;
}

View File

@ -303,7 +303,7 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args)
case LOAD_STRING:
{
LoadString* ls = static_cast<LoadString*>(instruction);
(*registers)[dst(ls)] = JSValue(new JSString(src1(ls)));
(*registers)[dst(ls)] = JSValue(src1(ls));
}
break;
case BRANCH:

View File

@ -89,7 +89,7 @@ $ops{"LOAD_STRING"} =
{
super => "Instruction_2",
rem => "dest, immediate value (string)",
params => [ ("Register", "String" ) ]
params => [ ("Register", "JSString*" ) ]
};
$ops{"LOAD_NAME"} =
{
@ -415,7 +415,7 @@ sub get_print_body {
push (@oplist, "\"R\" << mOp$op");
} elsif ($type eq "Label*") {
push (@oplist, "\"Offset \" << mOp$op->mOffset");
} elsif ($type =~ /StringAtom/) {
} elsif ($type =~ /String/) {
push (@oplist, "\"'\" << *mOp$op << \"'\"");
} else {
push (@oplist, "mOp$op");

View File

@ -43,6 +43,7 @@ namespace JavaScript {
namespace VM {
using JSTypes::JSValues;
using JSTypes::JSString;
enum ICodeOp {
ADD, /* dest, source1, source2 */
@ -637,11 +638,11 @@ namespace VM {
}
};
class LoadString : public Instruction_2<Register, String *> {
class LoadString : public Instruction_2<Register, JSString*> {
public:
/* dest, immediate value (string) */
LoadString (Register aOp1, String *aOp2) :
Instruction_2<Register, String *>
LoadString (Register aOp1, JSString* aOp2) :
Instruction_2<Register, JSString*>
(LOAD_STRING, aOp1, aOp2) {};
virtual Formatter& print(Formatter& f) {
f << opcodeNames[LOAD_STRING] << "\t" << "R" << mOp1 << ", " << "'" << *mOp2 << "'";

View File

@ -149,7 +149,7 @@ namespace ICG {
Register ICodeGenerator::loadString(String &value)
{
Register dest = getRegister();
LoadString *instr = new LoadString(dest, &value);
LoadString *instr = new LoadString(dest, new JSString(value));
iCode->push_back(instr);
return dest;
}

View File

@ -303,7 +303,7 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args)
case LOAD_STRING:
{
LoadString* ls = static_cast<LoadString*>(instruction);
(*registers)[dst(ls)] = JSValue(new JSString(src1(ls)));
(*registers)[dst(ls)] = JSValue(src1(ls));
}
break;
case BRANCH:

View File

@ -43,6 +43,7 @@ namespace JavaScript {
namespace VM {
using JSTypes::JSValues;
using JSTypes::JSString;
enum ICodeOp {
ADD, /* dest, source1, source2 */
@ -637,11 +638,11 @@ namespace VM {
}
};
class LoadString : public Instruction_2<Register, String *> {
class LoadString : public Instruction_2<Register, JSString*> {
public:
/* dest, immediate value (string) */
LoadString (Register aOp1, String *aOp2) :
Instruction_2<Register, String *>
LoadString (Register aOp1, JSString* aOp2) :
Instruction_2<Register, JSString*>
(LOAD_STRING, aOp1, aOp2) {};
virtual Formatter& print(Formatter& f) {
f << opcodeNames[LOAD_STRING] << "\t" << "R" << mOp1 << ", " << "'" << *mOp2 << "'";

View File

@ -89,7 +89,7 @@ $ops{"LOAD_STRING"} =
{
super => "Instruction_2",
rem => "dest, immediate value (string)",
params => [ ("Register", "String" ) ]
params => [ ("Register", "JSString*" ) ]
};
$ops{"LOAD_NAME"} =
{
@ -415,7 +415,7 @@ sub get_print_body {
push (@oplist, "\"R\" << mOp$op");
} elsif ($type eq "Label*") {
push (@oplist, "\"Offset \" << mOp$op->mOffset");
} elsif ($type =~ /StringAtom/) {
} elsif ($type =~ /String/) {
push (@oplist, "\"'\" << *mOp$op << \"'\"");
} else {
push (@oplist, "mOp$op");