Speedup HInstruction::Verify() for pathological cases

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
parent ac712f13
...@@ -587,11 +587,10 @@ void HInstruction::Verify() { ...@@ -587,11 +587,10 @@ void HInstruction::Verify() {
HBasicBlock* other_block = other_operand->block(); HBasicBlock* other_block = other_operand->block();
if (cur_block == other_block) { if (cur_block == other_block) {
if (!other_operand->IsPhi()) { if (!other_operand->IsPhi()) {
HInstruction* cur = cur_block->first(); HInstruction* cur = this->previous();
while (cur != NULL) { while (cur != NULL) {
ASSERT(cur != this); // We should reach other_operand before!
if (cur == other_operand) break; if (cur == other_operand) break;
cur = cur->next(); cur = cur->previous();
} }
// Must reach other operand in the same block! // Must reach other operand in the same block!
ASSERT(cur == other_operand); ASSERT(cur == other_operand);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment