Bug 1204554 part 3.1 - Prevent lazy parsing if we have to spew lcov result. r=bhackett
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Thu, 01 Oct 2015 12:41:40 +0200
changeset 265602 35247eec9d6151731b08fb9f5919bbe6758a012b
parent 265601 673f622280ed4fb926e12fb012ba0054af4ece14
child 265603 c403924d9a60f483259be32ed7f33550adb2290f
push id15472
push usercbook@mozilla.com
push dateFri, 02 Oct 2015 11:51:34 +0000
treeherderfx-team@2c33ef6b27e0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1204554
milestone44.0a1
Bug 1204554 part 3.1 - Prevent lazy parsing if we have to spew lcov result. r=bhackett
js/src/frontend/BytecodeCompiler.cpp
js/src/jscntxt.h
--- a/js/src/frontend/BytecodeCompiler.cpp
+++ b/js/src/frontend/BytecodeCompiler.cpp
@@ -216,17 +216,18 @@ BytecodeCompiler::maybeCompressSource()
 
 bool
 BytecodeCompiler::canLazilyParse()
 {
     return options.canLazilyParse &&
            !HasNonSyntacticStaticScopeChain(enclosingStaticScope) &&
            !cx->compartment()->options().disableLazyParsing() &&
            !cx->compartment()->options().discardSource() &&
-           !options.sourceIsLazy;
+           !options.sourceIsLazy &&
+           !cx->lcovEnabled();
 }
 
 bool
 BytecodeCompiler::createParser()
 {
     if (canLazilyParse()) {
         syntaxParser.emplace(cx, alloc, options, sourceBuffer.get(), sourceBuffer.length(),
                              /* foldConstants = */ false, (Parser<SyntaxParseHandler>*) nullptr,
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -191,16 +191,17 @@ class ExclusiveContext : public ContextF
     void* runtimeAddressOfInterruptUint32() { return runtime_->addressOfInterruptUint32(); }
     void* stackLimitAddress(StackKind kind) { return &runtime_->mainThread.nativeStackLimit[kind]; }
     void* stackLimitAddressForJitCode(StackKind kind);
     uintptr_t stackLimit(StackKind kind) { return runtime_->mainThread.nativeStackLimit[kind]; }
     size_t gcSystemPageSize() { return gc::SystemPageSize(); }
     bool canUseSignalHandlers() const { return runtime_->canUseSignalHandlers(); }
     bool jitSupportsFloatingPoint() const { return runtime_->jitSupportsFloatingPoint; }
     bool jitSupportsSimd() const { return runtime_->jitSupportsSimd; }
+    bool lcovEnabled() const { return runtime_->lcovOutput.isEnabled(); }
 
     // Thread local data that may be accessed freely.
     DtoaState* dtoaState() {
         return perThreadData->dtoaState;
     }
 
     /*
      * "Entering" a compartment changes cx->compartment (which changes