| 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 912 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1797 | 1799 |
| 1798 | 1800 |
| 1799 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { | 1801 LInstruction* LChunkBuilder::DoDateField(HDateField* instr) { |
| 1800 LOperand* object = UseFixed(instr->value(), a0); | 1802 LOperand* object = UseFixed(instr->value(), a0); |
| 1801 LDateField* result = | 1803 LDateField* result = |
| 1802 new(zone()) LDateField(object, FixedTemp(a1), instr->index()); | 1804 new(zone()) LDateField(object, FixedTemp(a1), instr->index()); |
| 1803 return MarkAsCall(DefineFixed(result, v0), instr, CAN_DEOPTIMIZE_EAGERLY); | 1805 return MarkAsCall(DefineFixed(result, v0), instr, CAN_DEOPTIMIZE_EAGERLY); |
| 1804 } | 1806 } |
| 1805 | 1807 |
| 1806 | 1808 |
| 1809 LInstruction* LChunkBuilder::DoSeqStringGetChar(HSeqStringGetChar* instr) { |
| 1810 LOperand* string = UseRegisterAtStart(instr->string()); |
| 1811 LOperand* index = UseRegisterOrConstantAtStart(instr->index()); |
| 1812 return DefineAsRegister(new(zone()) LSeqStringGetChar(string, index)); |
| 1813 } |
| 1814 |
| 1815 |
| 1807 LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) { | 1816 LInstruction* LChunkBuilder::DoSeqStringSetChar(HSeqStringSetChar* instr) { |
| 1808 LOperand* string = UseRegister(instr->string()); | 1817 LOperand* string = UseRegister(instr->string()); |
| 1809 LOperand* index = UseRegisterOrConstant(instr->index()); | 1818 LOperand* index = UseRegisterOrConstant(instr->index()); |
| 1810 LOperand* value = UseRegister(instr->value()); | 1819 LOperand* value = UseRegister(instr->value()); |
| 1811 return new(zone()) LSeqStringSetChar(instr->encoding(), string, index, value); | 1820 return new(zone()) LSeqStringSetChar(string, index, value); |
| 1812 } | 1821 } |
| 1813 | 1822 |
| 1814 | 1823 |
| 1815 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { | 1824 LInstruction* LChunkBuilder::DoBoundsCheck(HBoundsCheck* instr) { |
| 1816 LOperand* value = UseRegisterOrConstantAtStart(instr->index()); | 1825 LOperand* value = UseRegisterOrConstantAtStart(instr->index()); |
| 1817 LOperand* length = UseRegister(instr->length()); | 1826 LOperand* length = UseRegister(instr->length()); |
| 1818 return AssignEnvironment(new(zone()) LBoundsCheck(value, length)); | 1827 return AssignEnvironment(new(zone()) LBoundsCheck(value, length)); |
| 1819 } | 1828 } |
| 1820 | 1829 |
| 1821 | 1830 |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2581 | 2590 |
| 2582 | 2591 |
| 2583 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2592 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2584 LOperand* object = UseRegister(instr->object()); | 2593 LOperand* object = UseRegister(instr->object()); |
| 2585 LOperand* index = UseRegister(instr->index()); | 2594 LOperand* index = UseRegister(instr->index()); |
| 2586 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); | 2595 return DefineAsRegister(new(zone()) LLoadFieldByIndex(object, index)); |
| 2587 } | 2596 } |
| 2588 | 2597 |
| 2589 | 2598 |
| 2590 } } // namespace v8::internal | 2599 } } // namespace v8::internal |
| OLD | NEW |