From 1645f3bf099e0cab8e683cc14d17f4b760e3cd84 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Wed, 22 Feb 2012 09:26:02 +0100 Subject: [PATCH] Bug 725357 - Move Monitor call from GetElementOperation to the interpreter. r=dvander --- js/src/jsinterp.cpp | 1 + js/src/jsinterpinlines.h | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/js/src/jsinterp.cpp b/js/src/jsinterp.cpp index bdd2f7b711c..cdfc74de975 100644 --- a/js/src/jsinterp.cpp +++ b/js/src/jsinterp.cpp @@ -2596,6 +2596,7 @@ BEGIN_CASE(JSOP_GETELEM) Value &rref = regs.sp[-1]; if (!GetElementOperation(cx, lref, rref, ®s.sp[-2])) goto error; + TypeScript::Monitor(cx, script, regs.pc, regs.sp[-2]); regs.sp--; } END_CASE(JSOP_GETELEM) diff --git a/js/src/jsinterpinlines.h b/js/src/jsinterpinlines.h index cc5812a3d73..34f5b3629cc 100644 --- a/js/src/jsinterpinlines.h +++ b/js/src/jsinterpinlines.h @@ -719,10 +719,6 @@ ToIdOperation(JSContext *cx, const Value &objval, const Value &idval, Value *res static JS_ALWAYS_INLINE bool GetObjectElementOperation(JSContext *cx, JSObject *obj, const Value &rref, Value *res) { - JSScript *script; - jsbytecode *pc; - types::TypeScript::GetPcScript(cx, &script, &pc); - uint32_t index; if (IsDefinitelyIndex(rref, &index)) { do { @@ -740,6 +736,10 @@ GetObjectElementOperation(JSContext *cx, JSObject *obj, const Value &rref, Value return false; } while(0); } else { + JSScript *script; + jsbytecode *pc; + types::TypeScript::GetPcScript(cx, &script, &pc); + if (script->hasAnalysis()) script->analysis()->getCode(pc).getStringElement = true; @@ -764,7 +764,6 @@ GetObjectElementOperation(JSContext *cx, JSObject *obj, const Value &rref, Value } assertSameCompartment(cx, *res); - types::TypeScript::Monitor(cx, script, pc, *res); return true; } @@ -779,7 +778,6 @@ GetElementOperation(JSContext *cx, const Value &lref, const Value &rref, Value * if (!str) return false; res->setString(str); - types::TypeScript::Monitor(cx, *res); return true; } } @@ -787,7 +785,6 @@ GetElementOperation(JSContext *cx, const Value &lref, const Value &rref, Value * if (lref.isMagic(JS_LAZY_ARGUMENTS)) { if (rref.isInt32() && size_t(rref.toInt32()) < cx->regs().fp()->numActualArgs()) { *res = cx->regs().fp()->canonicalActualArg(rref.toInt32()); - types::TypeScript::Monitor(cx, *res); return true; } types::MarkArgumentsCreated(cx, cx->fp()->script());