зеркало из https://github.com/mozilla/gecko-dev.git
Compile JSOP_DELNAME (bug 597137, r=dmandelin).
This commit is contained in:
Родитель
4d97ae7a36
Коммит
2b656fd125
|
@ -885,6 +885,18 @@ mjit::Compiler::generateMethod()
|
|||
jsop_pos();
|
||||
END_CASE(JSOP_POS)
|
||||
|
||||
BEGIN_CASE(JSOP_DELNAME)
|
||||
{
|
||||
uint32 index = fullAtomIndex(PC);
|
||||
JSAtom *atom = script->getAtom(index);
|
||||
|
||||
prepareStubCall(Uses(0));
|
||||
masm.move(ImmPtr(atom), Registers::ArgReg1);
|
||||
stubCall(stubs::DelName);
|
||||
frame.pushSynced();
|
||||
}
|
||||
END_CASE(JSOP_DELNAME)
|
||||
|
||||
BEGIN_CASE(JSOP_DELPROP)
|
||||
{
|
||||
uint32 index = fullAtomIndex(PC);
|
||||
|
|
|
@ -2665,6 +2665,28 @@ stubs::ArgSub(VMFrame &f, uint32 n)
|
|||
f.regs.sp[0] = rval;
|
||||
}
|
||||
|
||||
void JS_FASTCALL
|
||||
stubs::DelName(VMFrame &f, JSAtom *atom)
|
||||
{
|
||||
jsid id = ATOM_TO_JSID(atom);
|
||||
JSObject *obj, *obj2;
|
||||
JSProperty *prop;
|
||||
if (!js_FindProperty(f.cx, id, &obj, &obj2, &prop))
|
||||
THROW();
|
||||
|
||||
/* Strict mode code should never contain JSOP_DELNAME opcodes. */
|
||||
JS_ASSERT(!f.fp()->script()->strictModeCode);
|
||||
|
||||
/* ECMA says to return true if name is undefined or inherited. */
|
||||
f.regs.sp++;
|
||||
f.regs.sp[-1] = BooleanValue(true);
|
||||
if (prop) {
|
||||
obj2->dropProperty(f.cx, prop);
|
||||
if (!obj->deleteProperty(f.cx, id, &f.regs.sp[-1], false))
|
||||
THROW();
|
||||
}
|
||||
}
|
||||
|
||||
template<JSBool strict>
|
||||
void JS_FASTCALL
|
||||
stubs::DelProp(VMFrame &f, JSAtom *atom)
|
||||
|
|
|
@ -147,6 +147,7 @@ template<JSBool strict> void JS_FASTCALL DecElem(VMFrame &f);
|
|||
void JS_FASTCALL CallProp(VMFrame &f, JSAtom *atom);
|
||||
template <JSBool strict> void JS_FASTCALL DelProp(VMFrame &f, JSAtom *atom);
|
||||
template <JSBool strict> void JS_FASTCALL DelElem(VMFrame &f);
|
||||
void JS_FASTCALL DelName(VMFrame &f, JSAtom *atom);
|
||||
|
||||
void JS_FASTCALL DefVar(VMFrame &f, JSAtom *atom);
|
||||
template<JSBool strict> void JS_FASTCALL DefFun(VMFrame &f, JSFunction *fun);
|
||||
|
|
Загрузка…
Ссылка в новой задаче