Speedup HInstruction::Verify() for pathological cases
authorjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 17 Oct 2011 07:52:20 +0000 (07:52 +0000)
committerjkummerow@chromium.org <jkummerow@chromium.org@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Mon, 17 Oct 2011 07:52:20 +0000 (07:52 +0000)
BUG=v8:1767
TEST=mjsunit/numops-fuzz doesn't timeout in debug mode

Review URL: http://codereview.chromium.org/8302023

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9642 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

src/hydrogen-instructions.cc

index bbb56ee..a90e95f 100644 (file)
@@ -587,11 +587,10 @@ void HInstruction::Verify() {
     HBasicBlock* other_block = other_operand->block();
     if (cur_block == other_block) {
       if (!other_operand->IsPhi()) {
-        HInstruction* cur = cur_block->first();
+        HInstruction* cur = this->previous();
         while (cur != NULL) {
-          ASSERT(cur != this);  // We should reach other_operand before!
           if (cur == other_operand) break;
-          cur = cur->next();
+          cur = cur->previous();
         }
         // Must reach other operand in the same block!
         ASSERT(cur == other_operand);