| 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/linkage.h" | 5 #include "src/compiler/linkage.h" |
| 6 #include "src/compiler/pipeline-statistics.h" | 6 #include "src/compiler/pipeline-statistics.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 1507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 // TODO(bmeurer): This is a horrible hack to make sure that for constant | 1518 // TODO(bmeurer): This is a horrible hack to make sure that for constant |
| 1519 // live ranges, every use requires the constant to be in a register. | 1519 // live ranges, every use requires the constant to be in a register. |
| 1520 // Without this hack, all uses with "any" policy would get the constant | 1520 // Without this hack, all uses with "any" policy would get the constant |
| 1521 // operand assigned. | 1521 // operand assigned. |
| 1522 LiveRange* range = live_ranges_[i]; | 1522 LiveRange* range = live_ranges_[i]; |
| 1523 if (range->HasAllocatedSpillOperand() && | 1523 if (range->HasAllocatedSpillOperand() && |
| 1524 range->GetSpillOperand()->IsConstant()) { | 1524 range->GetSpillOperand()->IsConstant()) { |
| 1525 for (UsePosition* pos = range->first_pos(); pos != NULL; | 1525 for (UsePosition* pos = range->first_pos(); pos != NULL; |
| 1526 pos = pos->next_) { | 1526 pos = pos->next_) { |
| 1527 pos->register_beneficial_ = true; | 1527 pos->register_beneficial_ = true; |
| 1528 pos->requires_reg_ = true; | 1528 // TODO(dcarney): should the else case assert requires_reg_ == false? |
| 1529 // Can't mark phis as needing a register. |
| 1530 if (!code() |
| 1531 ->InstructionAt(pos->pos().InstructionIndex()) |
| 1532 ->IsGapMoves()) { |
| 1533 pos->requires_reg_ = true; |
| 1534 } |
| 1529 } | 1535 } |
| 1530 } | 1536 } |
| 1531 } | 1537 } |
| 1532 } | 1538 } |
| 1533 } | 1539 } |
| 1534 | 1540 |
| 1535 | 1541 |
| 1536 bool RegisterAllocator::SafePointsAreInOrder() const { | 1542 bool RegisterAllocator::SafePointsAreInOrder() const { |
| 1537 int safe_point = 0; | 1543 int safe_point = 0; |
| 1538 const PointerMapDeque* pointer_maps = code()->pointer_maps(); | 1544 const PointerMapDeque* pointer_maps = code()->pointer_maps(); |
| (...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2312 } else { | 2318 } else { |
| 2313 DCHECK(range->Kind() == GENERAL_REGISTERS); | 2319 DCHECK(range->Kind() == GENERAL_REGISTERS); |
| 2314 assigned_registers_->Add(reg); | 2320 assigned_registers_->Add(reg); |
| 2315 } | 2321 } |
| 2316 range->set_assigned_register(reg, code_zone()); | 2322 range->set_assigned_register(reg, code_zone()); |
| 2317 } | 2323 } |
| 2318 | 2324 |
| 2319 } | 2325 } |
| 2320 } | 2326 } |
| 2321 } // namespace v8::internal::compiler | 2327 } // namespace v8::internal::compiler |
| OLD | NEW |