Bug 1261826 part 10.1 - Baseline: Increment counter located at the entry point of a script. r=bhackett
authorNicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Mon, 23 May 2016 14:21:51 +0000
changeset 298493 c2b51f5ad84348a107cbf5e728f236e9e787b8ea
parent 298492 7f12d87c72c28f2398a2f358e39eef87e38f1c47
child 298494 91c13e5235077d947cea0e262f13485247750029
push id77194
push usernpierron@mozilla.com
push dateMon, 23 May 2016 14:22:04 +0000
treeherdermozilla-inbound@c2b51f5ad843 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs1261826
milestone49.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 1261826 part 10.1 - Baseline: Increment counter located at the entry point of a script. r=bhackett
js/src/jit/BaselineCompiler.cpp
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -987,16 +987,23 @@ BaselineCompiler::emitBody()
           case OP:                             \
             if (!this->emit_##OP())            \
                 return Method_Error;           \
             break;
 OPCODE_LIST(EMIT_OP)
 #undef EMIT_OP
         }
 
+        // If the main instruction is not a jump target, then we emit the
+        //  corresponding code coverage counter.
+        if (pc == script->main() && !BytecodeIsJumpTarget(op)) {
+            if (!emit_JSOP_JUMPTARGET())
+                return Method_Error;
+        }
+
         // Test if last instructions and stop emitting in that case.
         pc += GetBytecodeLength(pc);
         if (pc >= script->codeEnd())
             break;
 
         emittedOps++;
         lastOpUnreachable = false;
 #ifdef DEBUG