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 829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 void LChunkBuilder::VisitInstruction(HInstruction* current) { | 840 void LChunkBuilder::VisitInstruction(HInstruction* current) { |
841 HInstruction* old_current = current_instruction_; | 841 HInstruction* old_current = current_instruction_; |
842 current_instruction_ = current; | 842 current_instruction_ = current; |
843 if (current->has_position()) position_ = current->position(); | 843 if (current->has_position()) position_ = current->position(); |
844 | 844 |
845 LInstruction* instr = NULL; | 845 LInstruction* instr = NULL; |
846 if (current->CanReplaceWithDummyUses()) { | 846 if (current->CanReplaceWithDummyUses()) { |
847 if (current->OperandCount() == 0) { | 847 if (current->OperandCount() == 0) { |
848 instr = DefineAsRegister(new(zone()) LDummy()); | 848 instr = DefineAsRegister(new(zone()) LDummy()); |
849 } else { | 849 } else { |
| 850 ASSERT(!current->OperandAt(0)->IsControlInstruction()); |
850 instr = DefineAsRegister(new(zone()) | 851 instr = DefineAsRegister(new(zone()) |
851 LDummyUse(UseAny(current->OperandAt(0)))); | 852 LDummyUse(UseAny(current->OperandAt(0)))); |
852 } | 853 } |
853 for (int i = 1; i < current->OperandCount(); ++i) { | 854 for (int i = 1; i < current->OperandCount(); ++i) { |
| 855 if (current->OperandAt(i)->IsControlInstruction()) continue; |
854 LInstruction* dummy = | 856 LInstruction* dummy = |
855 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); | 857 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); |
856 dummy->set_hydrogen_value(current); | 858 dummy->set_hydrogen_value(current); |
857 chunk_->AddInstruction(dummy, current_block_); | 859 chunk_->AddInstruction(dummy, current_block_); |
858 } | 860 } |
859 } else { | 861 } else { |
860 instr = current->CompileToLithium(this); | 862 instr = current->CompileToLithium(this); |
861 } | 863 } |
862 | 864 |
863 argument_count_ += current->argument_delta(); | 865 argument_count_ += current->argument_delta(); |
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2486 } | 2488 } |
2487 | 2489 |
2488 | 2490 |
2489 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2491 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
2490 LOperand* object = UseRegister(instr->object()); | 2492 LOperand* object = UseRegister(instr->object()); |
2491 LOperand* index = UseRegister(instr->index()); | 2493 LOperand* index = UseRegister(instr->index()); |
2492 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2494 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
2493 } | 2495 } |
2494 | 2496 |
2495 } } // namespace v8::internal | 2497 } } // namespace v8::internal |
OLD | NEW |