| 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 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 int GetRegisterCount(const RegisterConfiguration* cfg, RegisterKind kind) { | 29 int GetRegisterCount(const RegisterConfiguration* cfg, RegisterKind kind) { |
| 30 return kind == DOUBLE_REGISTERS ? cfg->num_double_registers() | 30 return kind == DOUBLE_REGISTERS ? cfg->num_double_registers() |
| 31 : cfg->num_general_registers(); | 31 : cfg->num_general_registers(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 | 34 |
| 35 int GetAllocatableRegisterCount(const RegisterConfiguration* cfg, | 35 int GetAllocatableRegisterCount(const RegisterConfiguration* cfg, |
| 36 RegisterKind kind) { | 36 RegisterKind kind) { |
| 37 return kind == DOUBLE_REGISTERS | 37 return kind == DOUBLE_REGISTERS |
| 38 ? cfg->num_allocatable_aliased_double_registers() | 38 ? cfg->num_allocatable_aliased_double_registers(true) |
| 39 : cfg->num_allocatable_general_registers(); | 39 : cfg->num_allocatable_general_registers(); |
| 40 } | 40 } |
| 41 | 41 |
| 42 | 42 |
| 43 const int* GetAllocatableRegisterCodes(const RegisterConfiguration* cfg, | 43 const int* GetAllocatableRegisterCodes(const RegisterConfiguration* cfg, |
| 44 RegisterKind kind) { | 44 RegisterKind kind) { |
| 45 return kind == DOUBLE_REGISTERS ? cfg->allocatable_double_codes() | 45 return kind == DOUBLE_REGISTERS ? cfg->allocatable_double_codes() |
| 46 : cfg->allocatable_general_codes(); | 46 : cfg->allocatable_general_codes(); |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1949 int code = config()->GetAllocatableGeneralCode(i); | 1949 int code = config()->GetAllocatableGeneralCode(i); |
| 1950 if (!IsOutputRegisterOf(instr, Register::from_code(code))) { | 1950 if (!IsOutputRegisterOf(instr, Register::from_code(code))) { |
| 1951 auto range = FixedLiveRangeFor(code); | 1951 auto range = FixedLiveRangeFor(code); |
| 1952 range->AddUseInterval(curr_position, curr_position.End(), | 1952 range->AddUseInterval(curr_position, curr_position.End(), |
| 1953 allocation_zone()); | 1953 allocation_zone()); |
| 1954 } | 1954 } |
| 1955 } | 1955 } |
| 1956 } | 1956 } |
| 1957 | 1957 |
| 1958 if (instr->ClobbersDoubleRegisters()) { | 1958 if (instr->ClobbersDoubleRegisters()) { |
| 1959 for (int i = 0; i < config()->num_allocatable_aliased_double_registers(); | 1959 for (int i = 0; |
| 1960 ++i) { | 1960 i < config()->num_allocatable_aliased_double_registers(true); ++i) { |
| 1961 int code = config()->GetAllocatableDoubleCode(i); | 1961 int code = config()->GetAllocatableDoubleCode(i); |
| 1962 if (!IsOutputDoubleRegisterOf(instr, DoubleRegister::from_code(code))) { | 1962 if (!IsOutputDoubleRegisterOf(instr, DoubleRegister::from_code(code))) { |
| 1963 auto range = FixedDoubleLiveRangeFor(code); | 1963 auto range = FixedDoubleLiveRangeFor(code); |
| 1964 range->AddUseInterval(curr_position, curr_position.End(), | 1964 range->AddUseInterval(curr_position, curr_position.End(), |
| 1965 allocation_zone()); | 1965 allocation_zone()); |
| 1966 } | 1966 } |
| 1967 } | 1967 } |
| 1968 } | 1968 } |
| 1969 | 1969 |
| 1970 for (size_t i = 0; i < instr->InputCount(); i++) { | 1970 for (size_t i = 0; i < instr->InputCount(); i++) { |
| (...skipping 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3393 auto eliminate = moves->PrepareInsertAfter(move); | 3393 auto eliminate = moves->PrepareInsertAfter(move); |
| 3394 to_insert.push_back(move); | 3394 to_insert.push_back(move); |
| 3395 if (eliminate != nullptr) to_eliminate.push_back(eliminate); | 3395 if (eliminate != nullptr) to_eliminate.push_back(eliminate); |
| 3396 } | 3396 } |
| 3397 } | 3397 } |
| 3398 | 3398 |
| 3399 | 3399 |
| 3400 } // namespace compiler | 3400 } // namespace compiler |
| 3401 } // namespace internal | 3401 } // namespace internal |
| 3402 } // namespace v8 | 3402 } // namespace v8 |
| OLD | NEW |