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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 int value = imm->type() == ImmediateOperand::INLINE ? imm->inline_value() | 153 int value = imm->type() == ImmediateOperand::INLINE ? imm->inline_value() |
154 : imm->indexed_value(); | 154 : imm->indexed_value(); |
155 constraint->type_ = kImmediate; | 155 constraint->type_ = kImmediate; |
156 constraint->value_ = value; | 156 constraint->value_ = value; |
157 } else { | 157 } else { |
158 CHECK(op->IsUnallocated()); | 158 CHECK(op->IsUnallocated()); |
159 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(op); | 159 const UnallocatedOperand* unallocated = UnallocatedOperand::cast(op); |
160 int vreg = unallocated->virtual_register(); | 160 int vreg = unallocated->virtual_register(); |
161 constraint->virtual_register_ = vreg; | 161 constraint->virtual_register_ = vreg; |
162 if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) { | 162 if (unallocated->basic_policy() == UnallocatedOperand::FIXED_SLOT) { |
163 constraint->type_ = sequence()->IsFP(vreg) ? kFPSlot : kSlot; | 163 constraint->type_ = kFixedSlot; |
164 constraint->value_ = unallocated->fixed_slot_index(); | 164 constraint->value_ = unallocated->fixed_slot_index(); |
165 } else { | 165 } else { |
166 switch (unallocated->extended_policy()) { | 166 switch (unallocated->extended_policy()) { |
167 case UnallocatedOperand::ANY: | 167 case UnallocatedOperand::ANY: |
168 case UnallocatedOperand::NONE: | 168 case UnallocatedOperand::NONE: |
169 if (sequence()->IsFP(vreg)) { | 169 if (sequence()->IsFP(vreg)) { |
170 constraint->type_ = kNoneFP; | 170 constraint->type_ = kNoneFP; |
171 } else { | 171 } else { |
172 constraint->type_ = kNone; | 172 constraint->type_ = kNone; |
173 } | 173 } |
(...skipping 12 matching lines...) Expand all Loading... |
186 constraint->value_ = unallocated->fixed_register_index(); | 186 constraint->value_ = unallocated->fixed_register_index(); |
187 break; | 187 break; |
188 case UnallocatedOperand::MUST_HAVE_REGISTER: | 188 case UnallocatedOperand::MUST_HAVE_REGISTER: |
189 if (sequence()->IsFP(vreg)) { | 189 if (sequence()->IsFP(vreg)) { |
190 constraint->type_ = kFPRegister; | 190 constraint->type_ = kFPRegister; |
191 } else { | 191 } else { |
192 constraint->type_ = kRegister; | 192 constraint->type_ = kRegister; |
193 } | 193 } |
194 break; | 194 break; |
195 case UnallocatedOperand::MUST_HAVE_SLOT: | 195 case UnallocatedOperand::MUST_HAVE_SLOT: |
196 constraint->type_ = sequence()->IsFP(vreg) ? kFPSlot : kSlot; | 196 constraint->type_ = kSlot; |
| 197 constraint->value_ = |
| 198 ElementSizeLog2Of(sequence()->GetRepresentation(vreg)); |
197 break; | 199 break; |
198 case UnallocatedOperand::SAME_AS_FIRST_INPUT: | 200 case UnallocatedOperand::SAME_AS_FIRST_INPUT: |
199 constraint->type_ = kSameAsFirst; | 201 constraint->type_ = kSameAsFirst; |
200 break; | 202 break; |
201 } | 203 } |
202 } | 204 } |
203 } | 205 } |
204 } | 206 } |
205 | 207 |
206 void RegisterAllocatorVerifier::CheckConstraint( | 208 void RegisterAllocatorVerifier::CheckConstraint( |
(...skipping 25 matching lines...) Expand all Loading... |
232 case kFixedRegister: | 234 case kFixedRegister: |
233 case kRegisterAndSlot: | 235 case kRegisterAndSlot: |
234 CHECK(op->IsRegister()); | 236 CHECK(op->IsRegister()); |
235 CHECK_EQ(LocationOperand::cast(op)->register_code(), constraint->value_); | 237 CHECK_EQ(LocationOperand::cast(op)->register_code(), constraint->value_); |
236 return; | 238 return; |
237 case kFixedFPRegister: | 239 case kFixedFPRegister: |
238 CHECK(op->IsFPRegister()); | 240 CHECK(op->IsFPRegister()); |
239 CHECK_EQ(LocationOperand::cast(op)->register_code(), constraint->value_); | 241 CHECK_EQ(LocationOperand::cast(op)->register_code(), constraint->value_); |
240 return; | 242 return; |
241 case kFixedSlot: | 243 case kFixedSlot: |
242 CHECK(op->IsStackSlot()); | 244 CHECK(op->IsStackSlot() || op->IsFPStackSlot()); |
243 CHECK_EQ(LocationOperand::cast(op)->index(), constraint->value_); | 245 CHECK_EQ(LocationOperand::cast(op)->index(), constraint->value_); |
244 return; | 246 return; |
245 case kSlot: | 247 case kSlot: |
246 CHECK(op->IsStackSlot()); | 248 CHECK(op->IsStackSlot() || op->IsFPStackSlot()); |
247 return; | 249 CHECK_EQ(ElementSizeLog2Of(LocationOperand::cast(op)->representation()), |
248 case kFPSlot: | 250 constraint->value_); |
249 CHECK(op->IsFPStackSlot()); | |
250 return; | 251 return; |
251 case kNone: | 252 case kNone: |
252 CHECK(op->IsRegister() || op->IsStackSlot()); | 253 CHECK(op->IsRegister() || op->IsStackSlot()); |
253 return; | 254 return; |
254 case kNoneFP: | 255 case kNoneFP: |
255 CHECK(op->IsFPRegister() || op->IsFPStackSlot()); | 256 CHECK(op->IsFPRegister() || op->IsFPStackSlot()); |
256 return; | 257 return; |
257 case kSameAsFirst: | 258 case kSameAsFirst: |
258 CHECK(false); | 259 CHECK(false); |
259 return; | 260 return; |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 new (zone()) FinalAssessment(vreg, pending); | 550 new (zone()) FinalAssessment(vreg, pending); |
550 break; | 551 break; |
551 } | 552 } |
552 } | 553 } |
553 } | 554 } |
554 } | 555 } |
555 | 556 |
556 } // namespace compiler | 557 } // namespace compiler |
557 } // namespace internal | 558 } // namespace internal |
558 } // namespace v8 | 559 } // namespace v8 |
OLD | NEW |