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 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 } | 1080 } |
1081 | 1081 |
1082 | 1082 |
1083 bool RegisterAllocationData::IsBlockBoundary(LifetimePosition pos) const { | 1083 bool RegisterAllocationData::IsBlockBoundary(LifetimePosition pos) const { |
1084 return pos.IsFullStart() && | 1084 return pos.IsFullStart() && |
1085 code()->GetInstructionBlock(pos.ToInstructionIndex())->code_start() == | 1085 code()->GetInstructionBlock(pos.ToInstructionIndex())->code_start() == |
1086 pos.ToInstructionIndex(); | 1086 pos.ToInstructionIndex(); |
1087 } | 1087 } |
1088 | 1088 |
1089 | 1089 |
| 1090 void RegisterAllocationData::Print( |
| 1091 const InstructionSequence* instructionSequence) { |
| 1092 OFStream os(stdout); |
| 1093 PrintableInstructionSequence wrapper; |
| 1094 wrapper.register_configuration_ = config(); |
| 1095 wrapper.sequence_ = instructionSequence; |
| 1096 os << wrapper << std::endl; |
| 1097 } |
| 1098 |
| 1099 |
| 1100 void RegisterAllocationData::Print(const Instruction* instruction) { |
| 1101 OFStream os(stdout); |
| 1102 PrintableInstruction wrapper; |
| 1103 wrapper.instr_ = instruction; |
| 1104 wrapper.register_configuration_ = config(); |
| 1105 os << wrapper << std::endl; |
| 1106 } |
| 1107 |
| 1108 |
| 1109 void RegisterAllocationData::Print(const LiveRange* range, bool with_children) { |
| 1110 OFStream os(stdout); |
| 1111 PrintableLiveRange wrapper; |
| 1112 wrapper.register_configuration_ = config(); |
| 1113 for (const LiveRange* i = range; i != nullptr; i = i->next()) { |
| 1114 wrapper.range_ = i; |
| 1115 os << wrapper << std::endl; |
| 1116 if (!with_children) break; |
| 1117 } |
| 1118 } |
| 1119 |
| 1120 |
| 1121 void RegisterAllocationData::Print(const InstructionOperand& op) { |
| 1122 OFStream os(stdout); |
| 1123 PrintableInstructionOperand wrapper; |
| 1124 wrapper.register_configuration_ = config(); |
| 1125 wrapper.op_ = op; |
| 1126 os << wrapper << std::endl; |
| 1127 } |
| 1128 |
| 1129 |
| 1130 void RegisterAllocationData::Print(const MoveOperands* move) { |
| 1131 OFStream os(stdout); |
| 1132 PrintableInstructionOperand wrapper; |
| 1133 wrapper.register_configuration_ = config(); |
| 1134 wrapper.op_ = move->destination(); |
| 1135 os << wrapper << " = "; |
| 1136 wrapper.op_ = move->source(); |
| 1137 os << wrapper << std::endl; |
| 1138 } |
| 1139 |
| 1140 |
1090 ConstraintBuilder::ConstraintBuilder(RegisterAllocationData* data) | 1141 ConstraintBuilder::ConstraintBuilder(RegisterAllocationData* data) |
1091 : data_(data) {} | 1142 : data_(data) {} |
1092 | 1143 |
1093 | 1144 |
1094 InstructionOperand* ConstraintBuilder::AllocateFixed( | 1145 InstructionOperand* ConstraintBuilder::AllocateFixed( |
1095 UnallocatedOperand* operand, int pos, bool is_tagged) { | 1146 UnallocatedOperand* operand, int pos, bool is_tagged) { |
1096 TRACE("Allocating fixed reg for op %d\n", operand->virtual_register()); | 1147 TRACE("Allocating fixed reg for op %d\n", operand->virtual_register()); |
1097 DCHECK(operand->HasFixedPolicy()); | 1148 DCHECK(operand->HasFixedPolicy()); |
1098 InstructionOperand allocated; | 1149 InstructionOperand allocated; |
1099 MachineType machine_type = InstructionSequence::DefaultRepresentation(); | 1150 MachineType machine_type = InstructionSequence::DefaultRepresentation(); |
(...skipping 1784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2884 auto eliminate = moves->PrepareInsertAfter(move); | 2935 auto eliminate = moves->PrepareInsertAfter(move); |
2885 to_insert.push_back(move); | 2936 to_insert.push_back(move); |
2886 if (eliminate != nullptr) to_eliminate.push_back(eliminate); | 2937 if (eliminate != nullptr) to_eliminate.push_back(eliminate); |
2887 } | 2938 } |
2888 } | 2939 } |
2889 | 2940 |
2890 | 2941 |
2891 } // namespace compiler | 2942 } // namespace compiler |
2892 } // namespace internal | 2943 } // namespace internal |
2893 } // namespace v8 | 2944 } // namespace v8 |
OLD | NEW |