From 9a60f1ccd96ae22902de0d940d2375964562cb65 Mon Sep 17 00:00:00 2001 From: "Carsten \"Tomcat\" Book" Date: Wed, 26 Feb 2014 13:59:41 +0100 Subject: [PATCH] Backed out changeset 6f7f5787e46e (bug 953164) --- js/src/jit/Ion.cpp | 12 ++++++------ js/src/jit/IonAnalysis.cpp | 3 +++ js/src/jit/IonBuilder.cpp | 5 +++-- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp index 75e46732ae4f..eb05555143ca 100644 --- a/js/src/jit/Ion.cpp +++ b/js/src/jit/Ion.cpp @@ -1377,8 +1377,8 @@ OptimizeMIR(MIRGenerator *mir) // before its bounds check. if (!EliminateRedundantChecks(graph)) return false; - IonSpewPass("Bounds Check Elimination"); AssertGraphCoherency(graph); + IonSpewPass("Bounds Check Elimination"); } return true; @@ -1396,7 +1396,7 @@ GenerateLIR(MIRGenerator *mir) LIRGenerator lirgen(mir, graph, *lir); if (!lirgen.generate()) return nullptr; - IonSpewPass("Generate LIR"); + //IonSpewPass("Generate LIR"); if (mir->shouldCancel("Generate LIR")) return nullptr; @@ -1419,7 +1419,7 @@ GenerateLIR(MIRGenerator *mir) return nullptr; #endif - IonSpewPass("Allocate Registers [LSRA]", ®alloc); + //IonSpewPass("Allocate Registers [LSRA]", ®alloc); break; } @@ -1438,7 +1438,7 @@ GenerateLIR(MIRGenerator *mir) return nullptr; #endif - IonSpewPass("Allocate Registers [Backtracking]"); + //IonSpewPass("Allocate Registers [Backtracking]"); break; } @@ -1453,7 +1453,7 @@ GenerateLIR(MIRGenerator *mir) return nullptr; if (!integrity.check(true)) return nullptr; - IonSpewPass("Allocate Registers [Stupid]"); + //IonSpewPass("Allocate Registers [Stupid]"); break; } @@ -1468,7 +1468,7 @@ GenerateLIR(MIRGenerator *mir) // critical edges to avoid unnecessary jumps. if (!UnsplitEdges(lir)) return nullptr; - IonSpewPass("Unsplit Critical Edges"); + //IonSpewPass("Unsplit Critical Edges"); AssertBasicGraphCoherency(graph); return lir; diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp index a4b5a03df0a6..4aee9de7dd03 100644 --- a/js/src/jit/IonAnalysis.cpp +++ b/js/src/jit/IonAnalysis.cpp @@ -1287,6 +1287,7 @@ jit::AssertBasicGraphCoherency(MIRGraph &graph) // Assert successor and predecessor list coherency. uint32_t count = 0; + size_t compares = 0; for (MBasicBlockIterator block(graph.begin()); block != graph.end(); block++) { count++; @@ -1300,6 +1301,8 @@ jit::AssertBasicGraphCoherency(MIRGraph &graph) // Assert that use chains are valid for this instruction. for (MDefinitionIterator iter(*block); iter; iter++) { + if (iter->isCompare()) + compares++; for (uint32_t i = 0, e = iter->numOperands(); i < e; i++) JS_ASSERT(CheckOperandImpliesUse(*iter, iter->getOperand(i))); } diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp index 90aae062522a..1d5e4213c2b5 100644 --- a/js/src/jit/IonBuilder.cpp +++ b/js/src/jit/IonBuilder.cpp @@ -3032,12 +3032,13 @@ IonBuilder::filterTypesAtTest(MTest *test) return true; // Only do this optimization if the typeset does contains null or undefined. - if ((!(removeUndefined && subject->resultTypeSet()->hasType(types::Type::UndefinedType())) && - !(removeNull && subject->resultTypeSet()->hasType(types::Type::NullType())))) + if (!((removeUndefined && subject->resultTypeSet()->hasType(types::Type::UndefinedType())) || + (removeNull && subject->resultTypeSet()->hasType(types::Type::NullType())))) { return true; } + //printf("%d: replacing\n", script()->lineno()); // Find all values on the stack that correspond to the subject // and replace it with a MIR with filtered TypeSet information. // Create the replacement MIR lazily upon first occurence.