Reviewers: titzer,
Message:
ptal
Description:
[turbofan] more verification of rpo
[email protected]
BUG=
Please review this at https://codereview.chromium.org/603533002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+13, -15 lines):
M src/compiler/scheduler.cc
M test/cctest/compiler/test-run-machops.cc
Index: src/compiler/scheduler.cc
diff --git a/src/compiler/scheduler.cc b/src/compiler/scheduler.cc
index
402995006b410b9f2fc45df9b53f36b00f677acc..242c580aaaf6907bc4aab7d3a69bba50f53dd0aa
100644
--- a/src/compiler/scheduler.cc
+++ b/src/compiler/scheduler.cc
@@ -865,6 +865,19 @@ static void VerifySpecialRPO(int num_loops, LoopInfo*
loops,
DCHECK(order->size() > 0);
DCHECK((*order)[0]->id() == 0); // entry should be first.
+ // All predecessors and successors should be in rpo.
+ for (BasicBlockVector::iterator i = order->begin(); i != order->end();
++i) {
+ BasicBlock* block = *i;
+ BasicBlock::Predecessors p = block->predecessors();
+ for (BasicBlock::Predecessors::iterator j = p.begin(); j != p.end();
++j) {
+ DCHECK((*j)->rpo_number_ >= 0);
+ }
+ BasicBlock::Successors s = block->successors();
+ for (BasicBlock::Successors::iterator j = s.begin(); j != s.end();
++j) {
+ DCHECK((*j)->rpo_number_ >= 0);
+ }
+ }
+
for (int i = 0; i < num_loops; i++) {
LoopInfo* loop = &loops[i];
BasicBlock* header = loop->header;
Index: test/cctest/compiler/test-run-machops.cc
diff --git a/test/cctest/compiler/test-run-machops.cc
b/test/cctest/compiler/test-run-machops.cc
index
985e0f8ff619852457fbab807f73be0d34fb4c1a..d6cdebc0b408d6104a9a1fd48c3a0ddcbaf2a609
100644
--- a/test/cctest/compiler/test-run-machops.cc
+++ b/test/cctest/compiler/test-run-machops.cc
@@ -142,21 +142,6 @@ TEST(RunRedundantBranch1) {
TEST(RunRedundantBranch2) {
RawMachineAssemblerTester<int32_t> m;
- int constant = 955777;
-
- MLabel blocka, blockb;
- m.Branch(m.Int32Constant(0), &blocka, &blocka);
- m.Bind(&blockb);
- m.Goto(&blocka);
- m.Bind(&blocka);
- m.Return(m.Int32Constant(constant));
-
- CHECK_EQ(constant, m.Call());
-}
-
-
-TEST(RunRedundantBranch3) {
- RawMachineAssemblerTester<int32_t> m;
int constant = 966777;
MLabel blocka, blockb, blockc;
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.