Backout 6f31bcbcdbf4 (bug 781859) for Android M8 failures
authorEd Morley <emorley@mozilla.com>
Wed, 03 Oct 2012 15:39:08 +0100
changeset 109181 65404c2b69c4d499d1f49771e3eab0e40685df8e
parent 109180 066fea4aa2855a092e6479058329ae8cff01550e
child 109182 5a5dabf022b72c35c86172c6c75dc951ab24c315
push id82
push usershu@rfrn.org
push dateFri, 05 Oct 2012 13:20:22 +0000
bugs781859
milestone18.0a1
backs out6f31bcbcdbf466f4fe2c1d9b903098ed057b2195
Backout 6f31bcbcdbf4 (bug 781859) for Android M8 failures
js/src/jit-test/tests/jaeger/bug781859-1.js
js/src/jit-test/tests/jaeger/bug781859-2.js
js/src/jit-test/tests/jaeger/bug781859-3.js
js/src/methodjit/Compiler.cpp
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug781859-1.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// |jit-test| error:ReferenceError
-function e() {
-    try {} catch (e) {
-    return (actual = "FAIL");
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-      a.x + a.x + a.x + a.x + a.x + a.x + a.x + a.x
-    }
-    while (t) continue;
-}
-e();
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug781859-2.js
+++ /dev/null
@@ -1,9 +0,0 @@
-mjitChunkLimit(42);
-Function("\
-    switch (/x/) {\
-        case 8:\
-        break;\
-        t(function(){})\
-    }\
-    while (false)(function(){})\
-")()
deleted file mode 100644
--- a/js/src/jit-test/tests/jaeger/bug781859-3.js
+++ /dev/null
@@ -1,10 +0,0 @@
-mjitChunkLimit(10);
-function e() {
-    try {
-        var t = undefined;
-    } catch (e) { }
-    while (t)
-        continue;
-}
-for (var i = 0; i < 20; i++)
-  e();
--- a/js/src/methodjit/Compiler.cpp
+++ b/js/src/methodjit/Compiler.cpp
@@ -861,32 +861,16 @@ MakeJITScript(JSContext *cx, JSScript *s
                     const CrossChunkEdge &edge = currentEdges[i];
                     if (edge.target >= nextOffset) {
                         analysis->getCode(edge.target).safePoint = true;
                         if (!edges.append(edge))
                             return NULL;
                     }
                 }
                 currentEdges.clear();
-
-                /*
-                 * A loop's LOOPHEAD instruction is usually marked as safepoint if
-                 * either:
-                 *   (1) The whole loop is contained in a single chunk and tracked
-                 *       in the compiler (see shouldStartLoop).
-                 *   (2) The loop's backedge and LOOPHEAD are in different chunks.
-                 *
-                 * If a while loop follows an unreachable op, we may insert a chunk
-                 * boundary between the loop's initial GOTO and LOOPHEAD. In this
-                 * case we have to explicitly mark the LOOPHEAD as safepoint since
-                 * both of these conditions don't apply.
-                 */
-                jsbytecode *nextpc = script->code + nextOffset;
-                if (JSOp(*nextpc) == JSOP_LOOPHEAD)
-                    analysis->getCode(chunkStart).safePoint = true;
             }
         }
 
         if (chunkStart != script->length) {
             ChunkDescriptor desc;
             desc.begin = chunkStart;
             desc.end = script->length;
             if (!chunks.append(desc))
@@ -2042,16 +2026,19 @@ mjit::Compiler::shouldStartLoop(jsbyteco
     return false;
 }
 
 CompileStatus
 mjit::Compiler::generateMethod()
 {
     SrcNoteLineScanner scanner(script_->notes(), script_->lineno);
 
+    /* For join points, whether there was fallthrough from the previous opcode. */
+    bool fallthrough = true;
+
     /* Last bytecode processed. */
     jsbytecode *lastPC = NULL;
 
     if (!outerJIT())
         return Compile_Retry;
 
     uint32_t chunkBegin = 0, chunkEnd = script_->length;
     if (!a->parent) {
@@ -2090,19 +2077,16 @@ mjit::Compiler::generateMethod()
 
         if (chunkIndex != 0) {
             uint32_t depth = analysis->getCode(PC).stackDepth;
             for (uint32_t i = 0; i < depth; i++)
                 frame.pushSynced(JSVAL_TYPE_UNKNOWN);
         }
     }
 
-    /* For join points, whether there was fallthrough from the previous opcode. */
-    bool fallthrough = (chunkIndex == 0 || analysis->maybeCode(PC)->fallthrough);
-
     for (;;) {
         JSOp op = JSOp(*PC);
         int trap = stubs::JSTRAP_NONE;
 
         if (script_->hasBreakpointsAt(PC))
             trap |= stubs::JSTRAP_TRAP;
 
         Bytecode *opinfo = analysis->maybeCode(PC);
@@ -7111,28 +7095,16 @@ mjit::Compiler::startLoop(jsbytecode *he
 
 bool
 mjit::Compiler::finishLoop(jsbytecode *head)
 {
     if (!cx->typeInferenceEnabled() || !bytecodeInChunk(head))
         return true;
 
     /*
-     * Edge case: for a while loop, the initial GOTO and LOOPHEAD following it
-     * may be in different chunks. In that case bytecodeInChunk(head) may be
-     * true, but we didn't track this loop, since the GOTO is in the previous
-     * chunk.
-     */
-    if (!loop) {
-        JS_ASSERT(chunkIndex > 0);
-        JS_ASSERT(head - outerScript->code == outerChunk.begin);
-        return true;
-    }
-
-    /*
      * We're done processing the current loop. Every loop has exactly one backedge
      * at the end ('continue' statements are forward jumps to the loop test),
      * and after jumpAndRun'ing on that edge we can pop it from the frame.
      */
     JS_ASSERT(loop && loop->headOffset() == uint32_t(head - script_->code));
 
     jsbytecode *entryTarget = script_->code + loop->entryOffset();