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/compiler/common-operator.h" | 5 #include "src/compiler/common-operator.h" |
6 #include "src/compiler/graph.h" | 6 #include "src/compiler/graph.h" |
7 #include "src/compiler/instruction.h" | 7 #include "src/compiler/instruction.h" |
8 #include "src/compiler/schedule.h" | 8 #include "src/compiler/schedule.h" |
9 #include "src/compiler/state-values-utils.h" | 9 #include "src/compiler/state-values-utils.h" |
10 | 10 |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 case kOverflow: | 52 case kOverflow: |
53 case kNotOverflow: | 53 case kNotOverflow: |
54 case kUnorderedEqual: | 54 case kUnorderedEqual: |
55 case kUnorderedNotEqual: | 55 case kUnorderedNotEqual: |
56 return condition; | 56 return condition; |
57 } | 57 } |
58 UNREACHABLE(); | 58 UNREACHABLE(); |
59 return condition; | 59 return condition; |
60 } | 60 } |
61 | 61 |
| 62 bool InstructionOperand::InterferesWith(const InstructionOperand& that) const { |
| 63 if (!IsFPRegister() || !that.IsFPRegister()) return EqualsCanonicalized(that); |
| 64 return LocationOperand::cast(this)->register_code() == |
| 65 LocationOperand::cast(that).register_code(); |
| 66 } |
62 | 67 |
63 void InstructionOperand::Print(const RegisterConfiguration* config) const { | 68 void InstructionOperand::Print(const RegisterConfiguration* config) const { |
64 OFStream os(stdout); | 69 OFStream os(stdout); |
65 PrintableInstructionOperand wrapper; | 70 PrintableInstructionOperand wrapper; |
66 wrapper.register_configuration_ = config; | 71 wrapper.register_configuration_ = config; |
67 wrapper.op_ = *this; | 72 wrapper.op_ = *this; |
68 os << wrapper << std::endl; | 73 os << wrapper << std::endl; |
69 } | 74 } |
70 | 75 |
71 | 76 |
72 void InstructionOperand::Print() const { | 77 void InstructionOperand::Print() const { |
73 const RegisterConfiguration* config = | 78 const RegisterConfiguration* config = |
74 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN); | 79 RegisterConfiguration::ArchDefault(RegisterConfiguration::TURBOFAN); |
75 Print(config); | 80 Print(config); |
76 } | 81 } |
77 | 82 |
78 | |
79 std::ostream& operator<<(std::ostream& os, | 83 std::ostream& operator<<(std::ostream& os, |
80 const PrintableInstructionOperand& printable) { | 84 const PrintableInstructionOperand& printable) { |
81 const InstructionOperand& op = printable.op_; | 85 const InstructionOperand& op = printable.op_; |
82 const RegisterConfiguration* conf = printable.register_configuration_; | 86 const RegisterConfiguration* conf = printable.register_configuration_; |
83 switch (op.kind()) { | 87 switch (op.kind()) { |
84 case InstructionOperand::UNALLOCATED: { | 88 case InstructionOperand::UNALLOCATED: { |
85 const UnallocatedOperand* unalloc = UnallocatedOperand::cast(&op); | 89 const UnallocatedOperand* unalloc = UnallocatedOperand::cast(&op); |
86 os << "v" << unalloc->virtual_register(); | 90 os << "v" << unalloc->virtual_register(); |
87 if (unalloc->basic_policy() == UnallocatedOperand::FIXED_SLOT) { | 91 if (unalloc->basic_policy() == UnallocatedOperand::FIXED_SLOT) { |
88 return os << "(=" << unalloc->fixed_slot_index() << "S)"; | 92 return os << "(=" << unalloc->fixed_slot_index() << "S)"; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 } | 178 } |
175 return os << "]"; | 179 return os << "]"; |
176 } | 180 } |
177 case InstructionOperand::INVALID: | 181 case InstructionOperand::INVALID: |
178 return os << "(x)"; | 182 return os << "(x)"; |
179 } | 183 } |
180 UNREACHABLE(); | 184 UNREACHABLE(); |
181 return os; | 185 return os; |
182 } | 186 } |
183 | 187 |
184 | |
185 void MoveOperands::Print(const RegisterConfiguration* config) const { | 188 void MoveOperands::Print(const RegisterConfiguration* config) const { |
186 OFStream os(stdout); | 189 OFStream os(stdout); |
187 PrintableInstructionOperand wrapper; | 190 PrintableInstructionOperand wrapper; |
188 wrapper.register_configuration_ = config; | 191 wrapper.register_configuration_ = config; |
189 wrapper.op_ = destination(); | 192 wrapper.op_ = destination(); |
190 os << wrapper << " = "; | 193 os << wrapper << " = "; |
191 wrapper.op_ = source(); | 194 wrapper.op_ = source(); |
192 os << wrapper << std::endl; | 195 os << wrapper << std::endl; |
193 } | 196 } |
194 | 197 |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1029 } | 1032 } |
1030 for (int i = 0; i < code.InstructionBlockCount(); i++) { | 1033 for (int i = 0; i < code.InstructionBlockCount(); i++) { |
1031 printable.sequence_->PrintBlock(printable.register_configuration_, i); | 1034 printable.sequence_->PrintBlock(printable.register_configuration_, i); |
1032 } | 1035 } |
1033 return os; | 1036 return os; |
1034 } | 1037 } |
1035 | 1038 |
1036 } // namespace compiler | 1039 } // namespace compiler |
1037 } // namespace internal | 1040 } // namespace internal |
1038 } // namespace v8 | 1041 } // namespace v8 |
OLD | NEW |