зеркало из https://github.com/mozilla/pjs.git
added newObject(), saveName() and setProperty().
This commit is contained in:
Родитель
219208b7ee
Коммит
9c646bbafc
|
@ -77,6 +77,14 @@ namespace JavaScript {
|
|||
return dest;
|
||||
}
|
||||
|
||||
Register ICodeGenerator::newObject()
|
||||
{
|
||||
Register dest = getRegister();
|
||||
NewObject *instr = new NewObject(dest);
|
||||
iCode->push_back(instr);
|
||||
return dest;
|
||||
}
|
||||
|
||||
Register ICodeGenerator::loadName(StringAtom &name)
|
||||
{
|
||||
Register dest = getRegister();
|
||||
|
@ -84,6 +92,12 @@ namespace JavaScript {
|
|||
iCode->push_back(instr);
|
||||
return dest;
|
||||
}
|
||||
|
||||
void ICodeGenerator::saveName(StringAtom &name, Register value)
|
||||
{
|
||||
SaveName *instr = new SaveName(SAVE_NAME, &name, value);
|
||||
iCode->push_back(instr);
|
||||
}
|
||||
|
||||
Register ICodeGenerator::getProperty(StringAtom &name, Register base)
|
||||
{
|
||||
|
@ -93,6 +107,12 @@ namespace JavaScript {
|
|||
return dest;
|
||||
}
|
||||
|
||||
void ICodeGenerator::setProperty(StringAtom &name, Register base, Register value)
|
||||
{
|
||||
SetProp *instr = new SetProp(SET_PROP, &name, base, value);
|
||||
iCode->push_back(instr);
|
||||
}
|
||||
|
||||
void ICodeGenerator::saveVariable(uint32 frameIndex, Register value)
|
||||
{
|
||||
SaveVar *instr = new SaveVar(SAVE_VAR, frameIndex, value);
|
||||
|
@ -525,7 +545,7 @@ namespace JavaScript {
|
|||
|
||||
void ICodeGenerator::returnStatement(Register result)
|
||||
{
|
||||
Return *instr = new Return(RETURN, result);
|
||||
Return *instr = new Return(result);
|
||||
iCode->push_back(instr);
|
||||
}
|
||||
|
||||
|
@ -540,6 +560,7 @@ namespace JavaScript {
|
|||
"load_imm",
|
||||
"load_name",
|
||||
"save_name",
|
||||
"new_object",
|
||||
"get_prop",
|
||||
"set_prop",
|
||||
"add",
|
||||
|
|
|
@ -77,6 +77,14 @@ namespace JavaScript {
|
|||
return dest;
|
||||
}
|
||||
|
||||
Register ICodeGenerator::newObject()
|
||||
{
|
||||
Register dest = getRegister();
|
||||
NewObject *instr = new NewObject(dest);
|
||||
iCode->push_back(instr);
|
||||
return dest;
|
||||
}
|
||||
|
||||
Register ICodeGenerator::loadName(StringAtom &name)
|
||||
{
|
||||
Register dest = getRegister();
|
||||
|
@ -84,6 +92,12 @@ namespace JavaScript {
|
|||
iCode->push_back(instr);
|
||||
return dest;
|
||||
}
|
||||
|
||||
void ICodeGenerator::saveName(StringAtom &name, Register value)
|
||||
{
|
||||
SaveName *instr = new SaveName(SAVE_NAME, &name, value);
|
||||
iCode->push_back(instr);
|
||||
}
|
||||
|
||||
Register ICodeGenerator::getProperty(StringAtom &name, Register base)
|
||||
{
|
||||
|
@ -93,6 +107,12 @@ namespace JavaScript {
|
|||
return dest;
|
||||
}
|
||||
|
||||
void ICodeGenerator::setProperty(StringAtom &name, Register base, Register value)
|
||||
{
|
||||
SetProp *instr = new SetProp(SET_PROP, &name, base, value);
|
||||
iCode->push_back(instr);
|
||||
}
|
||||
|
||||
void ICodeGenerator::saveVariable(uint32 frameIndex, Register value)
|
||||
{
|
||||
SaveVar *instr = new SaveVar(SAVE_VAR, frameIndex, value);
|
||||
|
@ -525,7 +545,7 @@ namespace JavaScript {
|
|||
|
||||
void ICodeGenerator::returnStatement(Register result)
|
||||
{
|
||||
Return *instr = new Return(RETURN, result);
|
||||
Return *instr = new Return(result);
|
||||
iCode->push_back(instr);
|
||||
}
|
||||
|
||||
|
@ -540,6 +560,7 @@ namespace JavaScript {
|
|||
"load_imm",
|
||||
"load_name",
|
||||
"save_name",
|
||||
"new_object",
|
||||
"get_prop",
|
||||
"set_prop",
|
||||
"add",
|
||||
|
|
Загрузка…
Ссылка в новой задаче