Bug 1466503 part 1 - Pass script to GetIntrinsicOperation so it doesn't have to look it up. r=tcampbell
authorJan de Mooij <jdemooij@mozilla.com>
Wed, 20 Jun 2018 17:45:06 +0200
changeset 423158 0c4e97614565cb461db8a4eba531978b8ff45908
parent 423157 44a69a4ebc090ab49ed9872cb331c3de9749a025
child 423159 92d154bc6515cbc1baffa3cef8ec4b79edf89413
push id34164
push usercsabou@mozilla.com
push dateThu, 21 Jun 2018 01:17:13 +0000
treeherdermozilla-central@d231a3231680 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstcampbell
bugs1466503
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1466503 part 1 - Pass script to GetIntrinsicOperation so it doesn't have to look it up. r=tcampbell
js/src/jit/BaselineIC.cpp
js/src/vm/Interpreter-inl.h
js/src/vm/Interpreter.cpp
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -1371,17 +1371,17 @@ DoGetIntrinsicFallback(JSContext* cx, Ba
 
     RootedScript script(cx, frame->script());
     jsbytecode* pc = stub->icEntry()->pc(script);
     mozilla::DebugOnly<JSOp> op = JSOp(*pc);
     FallbackICSpew(cx, stub, "GetIntrinsic(%s)", CodeName[JSOp(*pc)]);
 
     MOZ_ASSERT(op == JSOP_GETINTRINSIC);
 
-    if (!GetIntrinsicOperation(cx, pc, res))
+    if (!GetIntrinsicOperation(cx, script, pc, res))
         return false;
 
     // An intrinsic operation will always produce the same result, so only
     // needs to be monitored once. Attach a stub to load the resulting constant
     // directly.
 
     TypeScript::Monitor(cx, script, pc, res);
 
--- a/js/src/vm/Interpreter-inl.h
+++ b/js/src/vm/Interpreter-inl.h
@@ -283,19 +283,19 @@ HasOwnProperty(JSContext* cx, HandleValu
         return false;
 
     // Step 3.
     return HasOwnProperty(cx, obj, key, result);
 }
 
 
 inline bool
-GetIntrinsicOperation(JSContext* cx, jsbytecode* pc, MutableHandleValue vp)
+GetIntrinsicOperation(JSContext* cx, HandleScript script, jsbytecode* pc, MutableHandleValue vp)
 {
-    RootedPropertyName name(cx, cx->currentScript()->getName(pc));
+    RootedPropertyName name(cx, script->getName(pc));
     return GlobalObject::getIntrinsicValue(cx, cx->global(), name, vp);
 }
 
 inline bool
 SetIntrinsicOperation(JSContext* cx, JSScript* script, jsbytecode* pc, HandleValue val)
 {
     RootedPropertyName name(cx, script->getName(pc));
     return GlobalObject::setIntrinsicValue(cx, cx->global(), name, val);
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -3265,17 +3265,17 @@ CASE(JSOP_GETIMPORT)
 
     TypeScript::Monitor(cx, script, REGS.pc, rval);
 }
 END_CASE(JSOP_GETIMPORT)
 
 CASE(JSOP_GETINTRINSIC)
 {
     ReservedRooted<Value> rval(&rootValue0);
-    if (!GetIntrinsicOperation(cx, REGS.pc, &rval))
+    if (!GetIntrinsicOperation(cx, script, REGS.pc, &rval))
         goto error;
 
     PUSH_COPY(rval);
     TypeScript::Monitor(cx, script, REGS.pc, rval);
 }
 END_CASE(JSOP_GETINTRINSIC)
 
 CASE(JSOP_UINT16)