Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: src/hydrogen-instructions.cc

Issue 8302023: Speedup HInstruction::Verify() for pathological cases (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 580
581 #ifdef DEBUG 581 #ifdef DEBUG
582 void HInstruction::Verify() { 582 void HInstruction::Verify() {
583 // Verify that input operands are defined before use. 583 // Verify that input operands are defined before use.
584 HBasicBlock* cur_block = block(); 584 HBasicBlock* cur_block = block();
585 for (int i = 0; i < OperandCount(); ++i) { 585 for (int i = 0; i < OperandCount(); ++i) {
586 HValue* other_operand = OperandAt(i); 586 HValue* other_operand = OperandAt(i);
587 HBasicBlock* other_block = other_operand->block(); 587 HBasicBlock* other_block = other_operand->block();
588 if (cur_block == other_block) { 588 if (cur_block == other_block) {
589 if (!other_operand->IsPhi()) { 589 if (!other_operand->IsPhi()) {
590 HInstruction* cur = cur_block->first(); 590 HInstruction* cur = this->previous();
591 while (cur != NULL) { 591 while (cur != NULL) {
592 ASSERT(cur != this); // We should reach other_operand before!
593 if (cur == other_operand) break; 592 if (cur == other_operand) break;
594 cur = cur->next(); 593 cur = cur->previous();
595 } 594 }
596 // Must reach other operand in the same block! 595 // Must reach other operand in the same block!
597 ASSERT(cur == other_operand); 596 ASSERT(cur == other_operand);
598 } 597 }
599 } else { 598 } else {
600 // If the following assert fires, you may have forgotten an 599 // If the following assert fires, you may have forgotten an
601 // AddInstruction. 600 // AddInstruction.
602 ASSERT(other_block->Dominates(cur_block)); 601 ASSERT(other_block->Dominates(cur_block));
603 } 602 }
604 } 603 }
(...skipping 1360 matching lines...) Expand 10 before | Expand all | Expand 10 after
1965 1964
1966 1965
1967 void HCheckPrototypeMaps::Verify() { 1966 void HCheckPrototypeMaps::Verify() {
1968 HInstruction::Verify(); 1967 HInstruction::Verify();
1969 ASSERT(HasNoUses()); 1968 ASSERT(HasNoUses());
1970 } 1969 }
1971 1970
1972 #endif 1971 #endif
1973 1972
1974 } } // namespace v8::internal 1973 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698