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 { |
11 namespace internal { | 11 namespace internal { |
12 namespace compiler { | 12 namespace compiler { |
13 | 13 |
14 #define TRACE(...) \ | 14 #define TRACE(...) \ |
15 do { \ | 15 do { \ |
16 if (FLAG_trace_alloc) PrintF(__VA_ARGS__); \ | 16 if (FLAG_trace_alloc) PrintF(__VA_ARGS__); \ |
17 } while (false) | 17 } while (false) |
18 | 18 |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 void RemoveElement(ZoneVector<LiveRange*>* v, LiveRange* range) { | 22 void RemoveElement(ZoneVector<LiveRange*>* v, LiveRange* range) { |
23 auto it = std::find(v->begin(), v->end(), range); | 23 auto it = std::find(v->begin(), v->end(), range); |
24 DCHECK(it != v->end()); | 24 DCHECK(it != v->end()); |
25 v->erase(it); | 25 v->erase(it); |
26 } | 26 } |
27 | 27 |
28 | |
29 int GetRegisterCount(const RegisterConfiguration* cfg, RegisterKind kind) { | 28 int GetRegisterCount(const RegisterConfiguration* cfg, RegisterKind kind) { |
30 return kind == DOUBLE_REGISTERS ? cfg->num_double_registers() | 29 return kind == DOUBLE_REGISTERS ? cfg->num_double_registers() |
31 : cfg->num_general_registers(); | 30 : cfg->num_general_registers(); |
32 } | 31 } |
33 | 32 |
34 | 33 |
35 int GetAllocatableRegisterCount(const RegisterConfiguration* cfg, | 34 int GetAllocatableRegisterCount(const RegisterConfiguration* cfg, |
36 RegisterKind kind) { | 35 RegisterKind kind) { |
37 return kind == DOUBLE_REGISTERS | 36 return kind == DOUBLE_REGISTERS |
38 ? cfg->num_allocatable_aliased_double_registers() | 37 ? cfg->num_allocatable_aliased_double_registers() |
(...skipping 3616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3655 spill_block->mark_needs_frame(); | 3654 spill_block->mark_needs_frame(); |
3656 } | 3655 } |
3657 } | 3656 } |
3658 } | 3657 } |
3659 } | 3658 } |
3660 | 3659 |
3661 | 3660 |
3662 } // namespace compiler | 3661 } // namespace compiler |
3663 } // namespace internal | 3662 } // namespace internal |
3664 } // namespace v8 | 3663 } // namespace v8 |
OLD | NEW |