| 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 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 701 if (needs_environment && !instr->HasEnvironment()) { | 701 if (needs_environment && !instr->HasEnvironment()) { |
| 702 instr = AssignEnvironment(instr); | 702 instr = AssignEnvironment(instr); |
| 703 } | 703 } |
| 704 | 704 |
| 705 return instr; | 705 return instr; |
| 706 } | 706 } |
| 707 | 707 |
| 708 | 708 |
| 709 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { | 709 LInstruction* LChunkBuilder::AssignPointerMap(LInstruction* instr) { |
| 710 ASSERT(!instr->HasPointerMap()); | 710 ASSERT(!instr->HasPointerMap()); |
| 711 instr->set_pointer_map(new(zone()) LPointerMap(position_, zone())); | 711 instr->set_pointer_map(new(zone()) LPointerMap(zone())); |
| 712 return instr; | 712 return instr; |
| 713 } | 713 } |
| 714 | 714 |
| 715 | 715 |
| 716 LUnallocated* LChunkBuilder::TempRegister() { | 716 LUnallocated* LChunkBuilder::TempRegister() { |
| 717 LUnallocated* operand = | 717 LUnallocated* operand = |
| 718 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); | 718 new(zone()) LUnallocated(LUnallocated::MUST_HAVE_REGISTER); |
| 719 int vreg = allocator_->GetVirtualRegister(); | 719 int vreg = allocator_->GetVirtualRegister(); |
| 720 if (!allocator_->AllocationOk()) { | 720 if (!allocator_->AllocationOk()) { |
| 721 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister); | 721 Abort(kOutOfVirtualRegistersWhileTryingToAllocateTempRegister); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 } | 901 } |
| 902 block->set_argument_count(argument_count_); | 902 block->set_argument_count(argument_count_); |
| 903 next_block_ = NULL; | 903 next_block_ = NULL; |
| 904 current_block_ = NULL; | 904 current_block_ = NULL; |
| 905 } | 905 } |
| 906 | 906 |
| 907 | 907 |
| 908 void LChunkBuilder::VisitInstruction(HInstruction* current) { | 908 void LChunkBuilder::VisitInstruction(HInstruction* current) { |
| 909 HInstruction* old_current = current_instruction_; | 909 HInstruction* old_current = current_instruction_; |
| 910 current_instruction_ = current; | 910 current_instruction_ = current; |
| 911 if (current->has_position()) position_ = current->position(); | |
| 912 | 911 |
| 913 LInstruction* instr = NULL; | 912 LInstruction* instr = NULL; |
| 914 if (current->CanReplaceWithDummyUses()) { | 913 if (current->CanReplaceWithDummyUses()) { |
| 915 HValue* first_operand = current->OperandCount() == 0 | 914 HValue* first_operand = current->OperandCount() == 0 |
| 916 ? graph()->GetConstant1() | 915 ? graph()->GetConstant1() |
| 917 : current->OperandAt(0); | 916 : current->OperandAt(0); |
| 918 instr = DefineAsRegister(new(zone()) LDummyUse(UseAny(first_operand))); | 917 instr = DefineAsRegister(new(zone()) LDummyUse(UseAny(first_operand))); |
| 919 for (int i = 1; i < current->OperandCount(); ++i) { | 918 for (int i = 1; i < current->OperandCount(); ++i) { |
| 920 LInstruction* dummy = | 919 LInstruction* dummy = |
| 921 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); | 920 new(zone()) LDummyUse(UseAny(current->OperandAt(i))); |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 if (LUnallocated::cast(instr->Output())->HasFixedPolicy()) ++fixed; | 955 if (LUnallocated::cast(instr->Output())->HasFixedPolicy()) ++fixed; |
| 957 } | 956 } |
| 958 for (TempIterator it(instr); !it.Done(); it.Advance()) { | 957 for (TempIterator it(instr); !it.Done(); it.Advance()) { |
| 959 LUnallocated* operand = LUnallocated::cast(it.Current()); | 958 LUnallocated* operand = LUnallocated::cast(it.Current()); |
| 960 if (operand->HasFixedPolicy()) ++fixed; | 959 if (operand->HasFixedPolicy()) ++fixed; |
| 961 } | 960 } |
| 962 ASSERT(fixed == 0 || used_at_start == 0); | 961 ASSERT(fixed == 0 || used_at_start == 0); |
| 963 } | 962 } |
| 964 #endif | 963 #endif |
| 965 | 964 |
| 966 instr->set_position(position_); | |
| 967 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { | 965 if (FLAG_stress_pointer_maps && !instr->HasPointerMap()) { |
| 968 instr = AssignPointerMap(instr); | 966 instr = AssignPointerMap(instr); |
| 969 } | 967 } |
| 970 if (FLAG_stress_environments && !instr->HasEnvironment()) { | 968 if (FLAG_stress_environments && !instr->HasEnvironment()) { |
| 971 instr = AssignEnvironment(instr); | 969 instr = AssignEnvironment(instr); |
| 972 } | 970 } |
| 973 if (!CpuFeatures::IsSafeForSnapshot(SSE2) && instr->IsGoto() && | 971 if (!CpuFeatures::IsSafeForSnapshot(SSE2) && instr->IsGoto() && |
| 974 LGoto::cast(instr)->jumps_to_join()) { | 972 LGoto::cast(instr)->jumps_to_join()) { |
| 975 // TODO(olivf) Since phis of spilled values are joined as registers | 973 // TODO(olivf) Since phis of spilled values are joined as registers |
| 976 // (not in the stack slot), we need to allow the goto gaps to keep one | 974 // (not in the stack slot), we need to allow the goto gaps to keep one |
| (...skipping 1752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2729 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { | 2727 LInstruction* LChunkBuilder::DoLoadFieldByIndex(HLoadFieldByIndex* instr) { |
| 2730 LOperand* object = UseRegister(instr->object()); | 2728 LOperand* object = UseRegister(instr->object()); |
| 2731 LOperand* index = UseTempRegister(instr->index()); | 2729 LOperand* index = UseTempRegister(instr->index()); |
| 2732 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); | 2730 return DefineSameAsFirst(new(zone()) LLoadFieldByIndex(object, index)); |
| 2733 } | 2731 } |
| 2734 | 2732 |
| 2735 | 2733 |
| 2736 } } // namespace v8::internal | 2734 } } // namespace v8::internal |
| 2737 | 2735 |
| 2738 #endif // V8_TARGET_ARCH_IA32 | 2736 #endif // V8_TARGET_ARCH_IA32 |
| OLD | NEW |