From 3988d415c75288f101366c7a94e28b615361b7d0 Mon Sep 17 00:00:00 2001 From: Wes Kocher Date: Fri, 20 Mar 2015 22:40:05 -0700 Subject: [PATCH] Backed out changeset 17eec5f30889 (bug 1145488) for ggc orange --- js/src/jit/BaselineBailouts.cpp | 12 ++++++------ js/src/jit/Ion.cpp | 11 +++++------ js/src/jit/IonBuilder.cpp | 6 ++---- js/src/jit/JitFrames.cpp | 5 ++--- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/js/src/jit/BaselineBailouts.cpp b/js/src/jit/BaselineBailouts.cpp index e91b921e63b..c997b593690 100644 --- a/js/src/jit/BaselineBailouts.cpp +++ b/js/src/jit/BaselineBailouts.cpp @@ -697,13 +697,13 @@ InitFromBailout(JSContext *cx, HandleScript caller, jsbytecode *callerPC, scopeChain = fun->environment(); } } else { - // For global scripts without a polluted global scope the scope - // chain is the script's global (Ion does not compile scripts - // with a polluted global scope). Also note that it's invalid to - // resume into the prologue in this case because the prologue - // expects the scope chain in R1 for eval and global scripts. + // For global, compile-and-go scripts the scope chain is the + // script's global (Ion does not compile non-compile-and-go + // scripts). Also note that it's invalid to resume into the + // prologue in this case because the prologue expects the scope + // chain in R1 for eval and global scripts. MOZ_ASSERT(!script->isForEval()); - MOZ_ASSERT(!script->hasPollutedGlobalScope()); + MOZ_ASSERT(script->compileAndGo()); scopeChain = &(script->global()); } } diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 7ff87f07161..e1971b99c61 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -2035,12 +2035,11 @@ CheckScript(JSContext *cx, JSScript *script, bool osr) return false; } - if (script->hasPollutedGlobalScope() && !script->functionNonDelazifying()) { - // Support functions with a polluted global scope but not other - // scripts. For global scripts, IonBuilder currently uses the global - // object as scope chain, this is not valid when the script has a - // polluted global scope. - TrackAndSpewIonAbort(cx, script, "has polluted global scope"); + if (!script->compileAndGo() && !script->functionNonDelazifying()) { + // Support non-CNG functions but not other scripts. For global scripts, + // IonBuilder currently uses the global object as scope chain, this is + // not valid for non-CNG code. + TrackAndSpewIonAbort(cx, script, "not compile-and-go"); return false; } diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 93b7bd2a054..8ea07451759 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -1200,10 +1200,8 @@ IonBuilder::initScopeChain(MDefinition *callee) return false; } } else { - // For global scripts without a polluted global scope, the scope chain - // is the global object. - MOZ_ASSERT(!script()->isForEval()); - MOZ_ASSERT(!script()->hasPollutedGlobalScope()); + // For CNG global scripts, the scope chain is the global object. + MOZ_ASSERT(script()->compileAndGo()); scope = constant(ObjectValue(script()->global())); } diff --git a/js/src/jit/JitFrames.cpp b/js/src/jit/JitFrames.cpp index 5b896e85f6c..88ebd1c9ed7 100644 --- a/js/src/jit/JitFrames.cpp +++ b/js/src/jit/JitFrames.cpp @@ -2494,10 +2494,9 @@ InlineFrameIterator::computeScopeChain(Value scopeChainValue, MaybeReadFallback if (isFunctionFrame()) return callee(fallback)->environment(); - // Ion does not handle non-function scripts that have anything other than - // the global on their scope chain. + // Ion does not handle scripts that are not compile-and-go. MOZ_ASSERT(!script()->isForEval()); - MOZ_ASSERT(!script()->hasPollutedGlobalScope()); + MOZ_ASSERT(script()->compileAndGo()); return &script()->global(); }