Bug 820676: Minor improvement. r=luke
authorNicholas D. Matsakis <nmatsakis@mozilla.com>
Thu, 13 Dec 2012 21:43:20 -0800
changeset 125137 d9e54b62a5f54cc36c6478dd5f152c484a32d348
parent 125136 0685e3a994e0fccabbf4a89f6dc3d2be0567e288
child 125138 d72d915e308b65b4cf4a726d3aee0cc74f651f84
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs820676
milestone20.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 820676: Minor improvement. r=luke
js/src/ion/UnreachableCodeElimination.cpp
--- a/js/src/ion/UnreachableCodeElimination.cpp
+++ b/js/src/ion/UnreachableCodeElimination.cpp
@@ -79,26 +79,24 @@ UnreachableCodeElimination::prunePointle
         MControlInstruction *ins = block->lastIns();
 
         // Rewrite test false or test true to goto.
         if (ins->isTest()) {
             MTest *testIns = ins->toTest();
             MDefinition *v = testIns->getOperand(0);
             if (v->isConstant()) {
                 const Value &val = v->toConstant()->value();
-                if (val.isBoolean()) {
-                    BranchDirection bdir = (val.isTrue() ? TRUE_BRANCH : FALSE_BRANCH);
-                    MBasicBlock *succ = testIns->branchSuccessor(bdir);
-                    MGoto *gotoIns = MGoto::New(succ);
-                    block->discardLastIns();
-                    block->end(gotoIns);
-                    MBasicBlock *successorWithPhis = block->successorWithPhis();
-                    if (successorWithPhis && successorWithPhis != succ)
-                        block->setSuccessorWithPhis(NULL, 0);
-                }
+                BranchDirection bdir = ToBoolean(val) ? TRUE_BRANCH : FALSE_BRANCH;
+                MBasicBlock *succ = testIns->branchSuccessor(bdir);
+                MGoto *gotoIns = MGoto::New(succ);
+                block->discardLastIns();
+                block->end(gotoIns);
+                MBasicBlock *successorWithPhis = block->successorWithPhis();
+                if (successorWithPhis && successorWithPhis != succ)
+                    block->setSuccessorWithPhis(NULL, 0);
             }
         }
 
         for (size_t i = 0; i < block->numSuccessors(); i++) {
             MBasicBlock *succ = block->getSuccessor(i);
             if (!succ->isMarked()) {
                 succ->mark();
                 marked_++;