Backed out changeset 87b0f81d811f (bug 876429) for jsreftest failures

This commit is contained in:
Ed Morley 2013-05-30 11:38:23 +01:00
parent c4be0ccdfc
commit b6e34d5e46
8 changed files with 8 additions and 64 deletions

View File

@ -3217,11 +3217,10 @@ EmitAssignment(JSContext *cx, BytecodeEmitter *bce, ParseNode *lhs, JSOp op, Par
break;
#endif
case PNK_CALL:
JS_ASSERT(lhs->pn_xflags & PNX_SETCALL);
if (!EmitTree(cx, bce, lhs))
return false;
if (Emit1(cx, bce, JSOP_POP) < 0)
return false;
JS_ASSERT(lhs->pn_xflags & PNX_SETCALL);
offset += 2;
break;
default:
JS_ASSERT(0);
@ -3333,11 +3332,8 @@ EmitAssignment(JSContext *cx, BytecodeEmitter *bce, ParseNode *lhs, JSOp op, Par
if (!EmitIndexOp(cx, lhs->getOp(), atomIndex, bce))
return false;
break;
case PNK_CALL:
/* Do nothing. The JSOP_SETCALL we emitted will always throw. */
JS_ASSERT(lhs->pn_xflags & PNX_SETCALL);
break;
case PNK_ELEM:
case PNK_CALL:
if (Emit1(cx, bce, JSOP_SETELEM) < 0)
return false;
break;
@ -5054,9 +5050,10 @@ EmitIncOrDec(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
return false;
break;
case PNK_CALL:
JS_ASSERT(pn2->pn_xflags & PNX_SETCALL);
if (!EmitTree(cx, bce, pn2))
return false;
if (Emit1(cx, bce, JSOP_POP) < 0)
return false;
break;
default:
JS_ASSERT(pn2->isKind(PNK_NAME));

View File

@ -2099,16 +2099,6 @@ BaselineCompiler::emit_JSOP_TYPEOFEXPR()
return emit_JSOP_TYPEOF();
}
typedef bool (*SetCallFn)(JSContext *);
static const VMFunction SetCallInfo = FunctionInfo<SetCallFn>(js::SetCallOperation);
bool
BaselineCompiler::emit_JSOP_SETCALL()
{
prepareVMCall();
return callVM(SetCallInfo);
}
typedef bool (*ThrowFn)(JSContext *, HandleValue);
static const VMFunction ThrowInfo = FunctionInfo<ThrowFn>(js::Throw);

View File

@ -144,7 +144,6 @@ namespace ion {
_(JSOP_INSTANCEOF) \
_(JSOP_TYPEOF) \
_(JSOP_TYPEOFEXPR) \
_(JSOP_SETCALL) \
_(JSOP_THROW) \
_(JSOP_TRY) \
_(JSOP_ENTERBLOCK) \

View File

@ -1,32 +0,0 @@
var calls = 0;
function g() {
calls++;
};
function test1() {
for (var i=0; i<20; i++) {
if (i > 18)
g() = 2;
}
}
try {
test1();
assertEq(0, 1);
} catch(e) {
assertEq(e instanceof ReferenceError, true);
}
assertEq(calls, 1);
function test2() {
for (var i=0; i<20; i++) {
if (i > 18)
g()++;
}
}
try {
test2();
assertEq(0, 1);
} catch(e) {
assertEq(e instanceof ReferenceError, true);
}
assertEq(calls, 2);

View File

@ -2288,7 +2288,7 @@ BEGIN_CASE(JSOP_FUNCALL)
BEGIN_CASE(JSOP_SETCALL)
{
JS_ALWAYS_FALSE(SetCallOperation(cx));
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_LEFTSIDE_OF_ASS);
goto error;
}
END_CASE(JSOP_SETCALL)
@ -3375,13 +3375,6 @@ js::DefFunOperation(JSContext *cx, HandleScript script, HandleObject scopeChain,
return JSObject::setProperty(cx, parent, parent, name, &rval, script->strict);
}
bool
js::SetCallOperation(JSContext *cx)
{
JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL, JSMSG_BAD_LEFTSIDE_OF_ASS);
return false;
}
bool
js::GetAndClearException(JSContext *cx, MutableHandleValue res)
{

View File

@ -397,9 +397,6 @@ DeleteElement(JSContext *cx, HandleValue val, HandleValue index, JSBool *bv);
bool
DefFunOperation(JSContext *cx, HandleScript script, HandleObject scopeChain, HandleFunction funArg);
bool
SetCallOperation(JSContext *cx);
bool
GetAndClearException(JSContext *cx, MutableHandleValue res);

View File

@ -171,7 +171,7 @@ OPDEF(JSOP_STRICTNE, 73, "strictne", "!==", 1, 2, 1, 10, JOF_BYTE|J
* for web compatibility. Instead we emit JSOP_SETCALL after the function call,
* an opcode that always throws.
*/
OPDEF(JSOP_SETCALL, 74, "setcall", NULL, 1, 0, 0, 18, JOF_BYTE)
OPDEF(JSOP_SETCALL, 74, "setcall", NULL, 1, 1, 2, 18, JOF_BYTE)
/*
* JSOP_ITER sets up a for-in or for-each-in loop using the JSITER_* flag bits

View File

@ -26,7 +26,7 @@ namespace js {
* and saved versions. If deserialization fails, the data should be
* invalidated if possible.
*/
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 145);
static const uint32_t XDR_BYTECODE_VERSION = uint32_t(0xb973c0de - 144);
class XDRBuffer {
public: