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/bit-vector.h" | 5 #include "src/bit-vector.h" |
6 #include "src/compiler/instruction.h" | 6 #include "src/compiler/instruction.h" |
7 #include "src/compiler/register-allocator-verifier.h" | 7 #include "src/compiler/register-allocator-verifier.h" |
8 | 8 |
9 namespace v8 { | 9 namespace v8 { |
10 namespace internal { | 10 namespace internal { |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 int value = imm->type() == ImmediateOperand::INLINE ? imm->inline_value() | 148 int value = imm->type() == ImmediateOperand::INLINE ? imm->inline_value() |
149 : imm->indexed_value(); | 149 : imm->indexed_value(); |
150 constraint->type_ = kImmediate; | 150 constraint->type_ = kImmediate; |
151 constraint->value_ = value; | 151 constraint->value_ = value; |
152 } else { | 152 } else { |
153 CHECK(op->IsUnallocated()); | 153 CHECK(op->IsUnallocated()); |
154 const auto* unallocated = UnallocatedOperand::cast(op); | 154 const auto* unallocated = UnallocatedOperand::cast(op); |
155 int vreg = unallocated->virtual_register(); | 155 int vreg = unallocated->virtual_register(); |
156 constraint->virtual_register_ = vreg; | 156 constraint->virtual_register_ = vreg; |
157 if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) { | 157 if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) { |
158 constraint->type_ = kFixedSlot; | 158 constraint->type_ = sequence()->IsFloat(vreg) ? kDoubleSlot : kSlot; |
159 constraint->value_ = unallocated->fixed_slot_index(); | 159 constraint->value_ = unallocated->fixed_slot_index(); |
160 } else { | 160 } else { |
161 switch (unallocated->extended_policy()) { | 161 switch (unallocated->extended_policy()) { |
162 case UnallocatedOperand::ANY: | 162 case UnallocatedOperand::ANY: |
163 CHECK(false); | 163 CHECK(false); |
164 break; | 164 break; |
165 case UnallocatedOperand::NONE: | 165 case UnallocatedOperand::NONE: |
166 if (sequence()->IsFloat(vreg)) { | 166 if (sequence()->IsFloat(vreg)) { |
167 constraint->type_ = kNoneDouble; | 167 constraint->type_ = kNoneDouble; |
168 } else { | 168 } else { |
169 constraint->type_ = kNone; | 169 constraint->type_ = kNone; |
170 } | 170 } |
171 break; | 171 break; |
172 case UnallocatedOperand::FIXED_REGISTER: | 172 case UnallocatedOperand::FIXED_REGISTER: |
173 constraint->type_ = kFixedRegister; | 173 constraint->type_ = kFixedRegister; |
174 constraint->value_ = unallocated->fixed_register_index(); | 174 constraint->value_ = unallocated->fixed_register_index(); |
175 break; | 175 break; |
176 case UnallocatedOperand::FIXED_DOUBLE_REGISTER: | 176 case UnallocatedOperand::FIXED_DOUBLE_REGISTER: |
177 constraint->type_ = kFixedDoubleRegister; | 177 constraint->type_ = kFixedDoubleRegister; |
178 constraint->value_ = unallocated->fixed_register_index(); | 178 constraint->value_ = unallocated->fixed_register_index(); |
179 break; | 179 break; |
180 case UnallocatedOperand::MUST_HAVE_REGISTER: | 180 case UnallocatedOperand::MUST_HAVE_REGISTER: |
181 if (sequence()->IsFloat(vreg)) { | 181 if (sequence()->IsFloat(vreg)) { |
182 constraint->type_ = kDoubleRegister; | 182 constraint->type_ = kDoubleRegister; |
183 } else { | 183 } else { |
184 constraint->type_ = kRegister; | 184 constraint->type_ = kRegister; |
185 } | 185 } |
186 break; | 186 break; |
187 case UnallocatedOperand::MUST_HAVE_SLOT: | 187 case UnallocatedOperand::MUST_HAVE_SLOT: |
188 if (sequence()->IsFloat(vreg)) { | 188 constraint->type_ = sequence()->IsFloat(vreg) ? kDoubleSlot : kSlot; |
189 constraint->type_ = kDoubleSlot; | |
190 } else { | |
191 constraint->type_ = kSlot; | |
192 } | |
193 break; | 189 break; |
194 case UnallocatedOperand::SAME_AS_FIRST_INPUT: | 190 case UnallocatedOperand::SAME_AS_FIRST_INPUT: |
195 constraint->type_ = kSameAsFirst; | 191 constraint->type_ = kSameAsFirst; |
196 break; | 192 break; |
197 } | 193 } |
198 } | 194 } |
199 } | 195 } |
200 } | 196 } |
201 | 197 |
202 | 198 |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 int virtual_register = op_constraints[count].virtual_register_; | 696 int virtual_register = op_constraints[count].virtual_register_; |
701 current->Define(zone(), instr->OutputAt(i), virtual_register); | 697 current->Define(zone(), instr->OutputAt(i), virtual_register); |
702 } | 698 } |
703 } | 699 } |
704 } | 700 } |
705 } | 701 } |
706 | 702 |
707 } // namespace compiler | 703 } // namespace compiler |
708 } // namespace internal | 704 } // namespace internal |
709 } // namespace v8 | 705 } // namespace v8 |
OLD | NEW |