OLD | NEW |
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 4366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4377 for (int i = 0; i < block->phis()->length(); i++) { | 4377 for (int i = 0; i < block->phis()->length(); i++) { |
4378 HPhi* phi = block->phis()->at(i); | 4378 HPhi* phi = block->phis()->at(i); |
4379 ASSERT(phi->ActualValue() == phi); | 4379 ASSERT(phi->ActualValue() == phi); |
4380 } | 4380 } |
4381 #endif | 4381 #endif |
4382 | 4382 |
4383 for (HInstruction* instruction = block->first(); | 4383 for (HInstruction* instruction = block->first(); |
4384 instruction != NULL; | 4384 instruction != NULL; |
4385 instruction = instruction->next()) { | 4385 instruction = instruction->next()) { |
4386 if (instruction->ActualValue() != instruction) { | 4386 if (instruction->ActualValue() != instruction) { |
4387 instruction->ReplaceAllUsesWith(instruction->ActualValue()); | 4387 ASSERT(instruction->IsInformativeDefinition()); |
| 4388 if (instruction->IsPurelyInformativeDefinition()) { |
| 4389 instruction->DeleteAndReplaceWith(instruction->RedefinedOperand()); |
| 4390 } else { |
| 4391 instruction->ReplaceAllUsesWith(instruction->ActualValue()); |
| 4392 } |
4388 } | 4393 } |
4389 } | 4394 } |
4390 } | 4395 } |
4391 } | 4396 } |
4392 | 4397 |
4393 | 4398 |
4394 void HOptimizedGraphBuilder::AddPhi(HPhi* instr) { | 4399 void HOptimizedGraphBuilder::AddPhi(HPhi* instr) { |
4395 ASSERT(current_block() != NULL); | 4400 ASSERT(current_block() != NULL); |
4396 current_block()->AddPhi(instr); | 4401 current_block()->AddPhi(instr); |
4397 } | 4402 } |
(...skipping 6269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10667 } | 10672 } |
10668 } | 10673 } |
10669 | 10674 |
10670 #ifdef DEBUG | 10675 #ifdef DEBUG |
10671 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 10676 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
10672 if (allocator_ != NULL) allocator_->Verify(); | 10677 if (allocator_ != NULL) allocator_->Verify(); |
10673 #endif | 10678 #endif |
10674 } | 10679 } |
10675 | 10680 |
10676 } } // namespace v8::internal | 10681 } } // namespace v8::internal |
OLD | NEW |