| 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 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 } | 861 } |
| 862 | 862 |
| 863 | 863 |
| 864 void LChunkBuilder::VisitInstruction(HInstruction* current) { | 864 void LChunkBuilder::VisitInstruction(HInstruction* current) { |
| 865 HInstruction* old_current = current_instruction_; | 865 HInstruction* old_current = current_instruction_; |
| 866 current_instruction_ = current; | 866 current_instruction_ = current; |
| 867 if (current->has_position()) position_ = current->position(); | 867 if (current->has_position()) position_ = current->position(); |
| 868 | 868 |
| 869 LInstruction* instr = NULL; | 869 LInstruction* instr = NULL; |
| 870 if (current->CanReplaceWithDummyUses()) { | 870 if (current->CanReplaceWithDummyUses()) { |
| 871 HValue* first_operand = current->OperandCount() == 0 | 871 if (current->OperandCount() == 0) { |
| 872 ? graph()->GetConstant1() | 872 instr = DefineAsRegister(new(zone()) LDummy()); |
| 873 : current->OperandAt(0); | 873 } else { |
| 874 instr = DefineAsRegister(new(zone()) LDummyUse(UseAny(first_operand))); | 874 instr = DefineAsRegister(new(zone()) |
| 875 LDummyUse(UseAny(current->OperandAt(0)))); |
| 876 } |
| 875 for (int i = 1; i < current->OperandCount(); ++i) { | 877 for (int i = 1; i < current->OperandCount(); ++i) { |
| 876 LInstruction* dummy = | 878 LInstruction* dummy = |
| 877 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); | 879 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); |
| 878 dummy->set_hydrogen_value(current); | 880 dummy->set_hydrogen_value(current); |
| 879 chunk_->AddInstruction(dummy, current_block_); | 881 chunk_->AddInstruction(dummy, current_block_); |
| 880 } | 882 } |
| 881 } else { | 883 } else { |
| 882 instr = current->CompileToLithium(this); | 884 instr = current->CompileToLithium(this); |
| 883 } | 885 } |
| 884 | 886 |
| (...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2588 | 2590 |
| 2589 | 2591 |
| 2590 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2592 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2591 LOperand* object = UseRegister(instr->object()); | 2593 LOperand* object = UseRegister(instr->object()); |
| 2592 LOperand* index = UseRegister(instr->index()); | 2594 LOperand* index = UseRegister(instr->index()); |
| 2593 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2595 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2594 } | 2596 } |
| 2595 | 2597 |
| 2596 | 2598 |
| 2597 } } // namespace v8::internal | 2599 } } // namespace v8::internal |
| OLD | NEW |