OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/compiler/linkage.h" | 6 #include "src/compiler/linkage.h" |
7 #include "src/compiler/register-allocator.h" | 7 #include "src/compiler/register-allocator.h" |
8 #include "src/string-stream.h" | 8 #include "src/string-stream.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1095 UnallocatedOperand* operand, int pos, bool is_tagged) { | 1095 UnallocatedOperand* operand, int pos, bool is_tagged) { |
1096 TRACE("Allocating fixed reg for op %d\n", operand->virtual_register()); | 1096 TRACE("Allocating fixed reg for op %d\n", operand->virtual_register()); |
1097 DCHECK(operand->HasFixedPolicy()); | 1097 DCHECK(operand->HasFixedPolicy()); |
1098 InstructionOperand allocated; | 1098 InstructionOperand allocated; |
1099 MachineType machine_type = InstructionSequence::DefaultRepresentation(); | 1099 MachineType machine_type = InstructionSequence::DefaultRepresentation(); |
1100 int virtual_register = operand->virtual_register(); | 1100 int virtual_register = operand->virtual_register(); |
1101 if (virtual_register != InstructionOperand::kInvalidVirtualRegister) { | 1101 if (virtual_register != InstructionOperand::kInvalidVirtualRegister) { |
1102 machine_type = data()->MachineTypeFor(virtual_register); | 1102 machine_type = data()->MachineTypeFor(virtual_register); |
1103 } | 1103 } |
1104 if (operand->HasFixedSlotPolicy()) { | 1104 if (operand->HasFixedSlotPolicy()) { |
1105 allocated = AllocatedOperand(AllocatedOperand::STACK_SLOT, machine_type, | 1105 AllocatedOperand::AllocatedKind kind = |
1106 operand->fixed_slot_index()); | 1106 IsFloatingPoint(machine_type) ? AllocatedOperand::DOUBLE_STACK_SLOT |
| 1107 : AllocatedOperand::STACK_SLOT; |
| 1108 allocated = |
| 1109 AllocatedOperand(kind, machine_type, operand->fixed_slot_index()); |
1107 } else if (operand->HasFixedRegisterPolicy()) { | 1110 } else if (operand->HasFixedRegisterPolicy()) { |
1108 allocated = AllocatedOperand(AllocatedOperand::REGISTER, machine_type, | 1111 allocated = AllocatedOperand(AllocatedOperand::REGISTER, machine_type, |
1109 operand->fixed_register_index()); | 1112 operand->fixed_register_index()); |
1110 } else if (operand->HasFixedDoubleRegisterPolicy()) { | 1113 } else if (operand->HasFixedDoubleRegisterPolicy()) { |
1111 DCHECK_NE(InstructionOperand::kInvalidVirtualRegister, virtual_register); | 1114 DCHECK_NE(InstructionOperand::kInvalidVirtualRegister, virtual_register); |
1112 allocated = AllocatedOperand(AllocatedOperand::DOUBLE_REGISTER, | 1115 allocated = AllocatedOperand(AllocatedOperand::DOUBLE_REGISTER, |
1113 machine_type, operand->fixed_register_index()); | 1116 machine_type, operand->fixed_register_index()); |
1114 } else { | 1117 } else { |
1115 UNREACHABLE(); | 1118 UNREACHABLE(); |
1116 } | 1119 } |
(...skipping 1767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 auto eliminate = moves->PrepareInsertAfter(move); | 2887 auto eliminate = moves->PrepareInsertAfter(move); |
2885 to_insert.push_back(move); | 2888 to_insert.push_back(move); |
2886 if (eliminate != nullptr) to_eliminate.push_back(eliminate); | 2889 if (eliminate != nullptr) to_eliminate.push_back(eliminate); |
2887 } | 2890 } |
2888 } | 2891 } |
2889 | 2892 |
2890 | 2893 |
2891 } // namespace compiler | 2894 } // namespace compiler |
2892 } // namespace internal | 2895 } // namespace internal |
2893 } // namespace v8 | 2896 } // namespace v8 |
OLD | NEW |