From d08b0cdd80d178177c3e6f1eda5dab9b67588826 Mon Sep 17 00:00:00 2001 From: Hannes Verschore Date: Tue, 1 Dec 2015 18:11:36 +0100 Subject: [PATCH] Bug 1226816: SharedStubs - Don't enable the call scripted get prop shared stub in ionmonkey yet, r=jandem --- js/src/jit-test/tests/ion/bug1226816.js | 11 +++++++++++ js/src/jit/SharedIC.cpp | 6 ++++-- js/src/jit/SharedIC.h | 4 ++-- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 js/src/jit-test/tests/ion/bug1226816.js diff --git a/js/src/jit-test/tests/ion/bug1226816.js b/js/src/jit-test/tests/ion/bug1226816.js new file mode 100644 index 000000000000..fc97c9c97d79 --- /dev/null +++ b/js/src/jit-test/tests/ion/bug1226816.js @@ -0,0 +1,11 @@ +// |jit-test| error: InternalError + +x = 1; +x; +function g(y) {} +g(this); +x = /x/; +function f() { + f(x.flags); +} +f(); diff --git a/js/src/jit/SharedIC.cpp b/js/src/jit/SharedIC.cpp index 3c16c01b6eac..0219ce149575 100644 --- a/js/src/jit/SharedIC.cpp +++ b/js/src/jit/SharedIC.cpp @@ -2552,7 +2552,7 @@ TryAttachNativeGetAccessorPropStub(JSContext* cx, HandleScript script, jsbytecod isTemporarilyUnoptimizable); // Try handling scripted getters. - if (cacheableCall && isScripted && !isDOMProxy) { + if (cacheableCall && isScripted && !isDOMProxy && engine == ICStubCompiler::Engine::Baseline) { RootedFunction callee(cx, &shape->getterObject()->as()); MOZ_ASSERT(callee->hasScript()); @@ -2565,7 +2565,7 @@ TryAttachNativeGetAccessorPropStub(JSContext* cx, HandleScript script, jsbytecod JitSpew(JitSpew_BaselineIC, " Generating GetProp(NativeObj/ScriptedGetter %s:%" PRIuSIZE ") stub", callee->nonLazyScript()->filename(), callee->nonLazyScript()->lineno()); - ICGetProp_CallScripted::Compiler compiler(cx, engine, monitorStub, obj, holder, callee, + ICGetProp_CallScripted::Compiler compiler(cx, monitorStub, obj, holder, callee, script->pcToOffset(pc)); ICStub* newStub = compiler.getStub(compiler.getStubSpace(script)); if (!newStub) @@ -3507,6 +3507,8 @@ ICGetPropNativeDoesNotExistCompiler::generateStubCode(MacroAssembler& masm) bool ICGetProp_CallScripted::Compiler::generateStubCode(MacroAssembler& masm) { + MOZ_ASSERT(engine_ == Engine::Baseline); + Label failure; Label failureLeaveStubFrame; AllocatableGeneralRegisterSet regs(availableGeneralRegs(1)); diff --git a/js/src/jit/SharedIC.h b/js/src/jit/SharedIC.h index 4112a3b93e2b..56dcfcf9515f 100644 --- a/js/src/jit/SharedIC.h +++ b/js/src/jit/SharedIC.h @@ -2931,9 +2931,9 @@ class ICGetProp_CallScripted : public ICGetPropCallGetter bool generateStubCode(MacroAssembler& masm); public: - Compiler(JSContext* cx, Engine engine, ICStub* firstMonitorStub, HandleObject obj, + Compiler(JSContext* cx, ICStub* firstMonitorStub, HandleObject obj, HandleObject holder, HandleFunction getter, uint32_t pcOffset) - : ICGetPropCallGetter::Compiler(cx, ICStub::GetProp_CallScripted, engine, + : ICGetPropCallGetter::Compiler(cx, ICStub::GetProp_CallScripted, Engine::Baseline, firstMonitorStub, obj, holder, getter, pcOffset, /* outerClass = */ nullptr) {}