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

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

Issue 10032029: Eliminate redundant array bound checks (checks already performed earlier in the DT). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: More small style fixes. Created 8 years, 7 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
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 } 409 }
410 410
411 411
412 void HValue::Kill() { 412 void HValue::Kill() {
413 // Instead of going through the entire use list of each operand, we only 413 // Instead of going through the entire use list of each operand, we only
414 // check the first item in each use list and rely on the tail() method to 414 // check the first item in each use list and rely on the tail() method to
415 // skip dead items, removing them lazily next time we traverse the list. 415 // skip dead items, removing them lazily next time we traverse the list.
416 SetFlag(kIsDead); 416 SetFlag(kIsDead);
417 for (int i = 0; i < OperandCount(); ++i) { 417 for (int i = 0; i < OperandCount(); ++i) {
418 HValue* operand = OperandAt(i); 418 HValue* operand = OperandAt(i);
419 if (operand == NULL) continue;
419 HUseListNode* first = operand->use_list_; 420 HUseListNode* first = operand->use_list_;
420 if (first != NULL && first->value() == this && first->index() == i) { 421 if (first != NULL && first->value() == this && first->index() == i) {
421 operand->use_list_ = first->tail(); 422 operand->use_list_ = first->tail();
422 } 423 }
423 } 424 }
424 } 425 }
425 426
426 427
427 void HValue::SetBlock(HBasicBlock* block) { 428 void HValue::SetBlock(HBasicBlock* block) {
428 ASSERT(block_ == NULL || block == NULL); 429 ASSERT(block_ == NULL || block == NULL);
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
601 if (next != NULL) next->previous_ = this; 602 if (next != NULL) next->previous_ = this;
602 } 603 }
603 604
604 605
605 #ifdef DEBUG 606 #ifdef DEBUG
606 void HInstruction::Verify() { 607 void HInstruction::Verify() {
607 // Verify that input operands are defined before use. 608 // Verify that input operands are defined before use.
608 HBasicBlock* cur_block = block(); 609 HBasicBlock* cur_block = block();
609 for (int i = 0; i < OperandCount(); ++i) { 610 for (int i = 0; i < OperandCount(); ++i) {
610 HValue* other_operand = OperandAt(i); 611 HValue* other_operand = OperandAt(i);
612 if (other_operand == NULL) continue;
611 HBasicBlock* other_block = other_operand->block(); 613 HBasicBlock* other_block = other_operand->block();
612 if (cur_block == other_block) { 614 if (cur_block == other_block) {
613 if (!other_operand->IsPhi()) { 615 if (!other_operand->IsPhi()) {
614 HInstruction* cur = this->previous(); 616 HInstruction* cur = this->previous();
615 while (cur != NULL) { 617 while (cur != NULL) {
616 if (cur == other_operand) break; 618 if (cur == other_operand) break;
617 cur = cur->previous(); 619 cur = cur->previous();
618 } 620 }
619 // Must reach other operand in the same block! 621 // Must reach other operand in the same block!
620 ASSERT(cur == other_operand); 622 ASSERT(cur == other_operand);
(...skipping 1713 matching lines...) Expand 10 before | Expand all | Expand 10 after
2334 2336
2335 2337
2336 void HCheckPrototypeMaps::Verify() { 2338 void HCheckPrototypeMaps::Verify() {
2337 HInstruction::Verify(); 2339 HInstruction::Verify();
2338 ASSERT(HasNoUses()); 2340 ASSERT(HasNoUses());
2339 } 2341 }
2340 2342
2341 #endif 2343 #endif
2342 2344
2343 } } // namespace v8::internal 2345 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698