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 3132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3143 if (pos <= current->Start()) { | 3143 if (pos <= current->Start()) { |
3144 // All registers are blocked. | 3144 // All registers are blocked. |
3145 return false; | 3145 return false; |
3146 } | 3146 } |
3147 | 3147 |
3148 if (pos < current->End()) { | 3148 if (pos < current->End()) { |
3149 // Register reg is available at the range start but becomes blocked before | 3149 // Register reg is available at the range start but becomes blocked before |
3150 // the range end. Split current at position where it becomes blocked. | 3150 // the range end. Split current at position where it becomes blocked. |
3151 LiveRange* tail = SplitRangeAt(current, pos); | 3151 LiveRange* tail = SplitRangeAt(current, pos); |
3152 AddToUnhandledSorted(tail); | 3152 AddToUnhandledSorted(tail); |
| 3153 |
| 3154 // Try to allocate preferred register once more. |
| 3155 if (TryAllocatePreferredReg(current, free_until_pos)) return true; |
3153 } | 3156 } |
3154 | 3157 |
3155 // Register reg is available at the range start and is free until the range | 3158 // Register reg is available at the range start and is free until the range |
3156 // end. | 3159 // end. |
3157 DCHECK(pos >= current->End()); | 3160 DCHECK(pos >= current->End()); |
3158 TRACE("Assigning free reg %s to live range %d:%d\n", RegisterName(reg), | 3161 TRACE("Assigning free reg %s to live range %d:%d\n", RegisterName(reg), |
3159 current->TopLevel()->vreg(), current->relative_id()); | 3162 current->TopLevel()->vreg(), current->relative_id()); |
3160 SetLiveRangeAssignedRegister(current, reg); | 3163 SetLiveRangeAssignedRegister(current, reg); |
3161 | 3164 |
3162 return true; | 3165 return true; |
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4010 } | 4013 } |
4011 } | 4014 } |
4012 } | 4015 } |
4013 } | 4016 } |
4014 } | 4017 } |
4015 | 4018 |
4016 | 4019 |
4017 } // namespace compiler | 4020 } // namespace compiler |
4018 } // namespace internal | 4021 } // namespace internal |
4019 } // namespace v8 | 4022 } // namespace v8 |
OLD | NEW |