| 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 845 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 } | 856 } |
| 857 | 857 |
| 858 | 858 |
| 859 void LChunkBuilder::VisitInstruction(HInstruction* current) { | 859 void LChunkBuilder::VisitInstruction(HInstruction* current) { |
| 860 HInstruction* old_current = current_instruction_; | 860 HInstruction* old_current = current_instruction_; |
| 861 current_instruction_ = current; | 861 current_instruction_ = current; |
| 862 if (current->has_position()) position_ = current->position(); | 862 if (current->has_position()) position_ = current->position(); |
| 863 | 863 |
| 864 LInstruction* instr = NULL; | 864 LInstruction* instr = NULL; |
| 865 if (current->CanReplaceWithDummyUses()) { | 865 if (current->CanReplaceWithDummyUses()) { |
| 866 HValue* first_operand = current->OperandCount() == 0 | 866 if (current->OperandCount() == 0) { |
| 867 ? graph()->GetConstant1() | 867 instr = DefineAsRegister(new(zone()) LDummy()); |
| 868 : current->OperandAt(0); | 868 } else { |
| 869 instr = DefineAsRegister(new(zone()) LDummyUse(UseAny(first_operand))); | 869 instr = DefineAsRegister(new(zone()) |
| 870 LDummyUse(UseAny(current->OperandAt(0)))); |
| 871 } |
| 870 for (int i = 1; i < current->OperandCount(); ++i) { | 872 for (int i = 1; i < current->OperandCount(); ++i) { |
| 871 LInstruction* dummy = | 873 LInstruction* dummy = |
| 872 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); | 874 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); |
| 873 dummy->set_hydrogen_value(current); | 875 dummy->set_hydrogen_value(current); |
| 874 chunk_->AddInstruction(dummy, current_block_); | 876 chunk_->AddInstruction(dummy, current_block_); |
| 875 } | 877 } |
| 876 } else { | 878 } else { |
| 877 instr = current->CompileToLithium(this); | 879 instr = current->CompileToLithium(this); |
| 878 } | 880 } |
| 879 | 881 |
| (...skipping 1786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2666 | 2668 |
| 2667 | 2669 |
| 2668 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2670 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2669 LOperand* object = UseRegister(instr->object()); | 2671 LOperand* object = UseRegister(instr->object()); |
| 2670 LOperand* index = UseRegister(instr->index()); | 2672 LOperand* index = UseRegister(instr->index()); |
| 2671 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2673 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2672 } | 2674 } |
| 2673 | 2675 |
| 2674 | 2676 |
| 2675 } } // namespace v8::internal | 2677 } } // namespace v8::internal |
| OLD | NEW |