| 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/utils/random-number-generator.h" | 5 #include "src/base/utils/random-number-generator.h" |
| 6 #include "src/compiler/pipeline.h" | 6 #include "src/compiler/pipeline.h" |
| 7 #include "test/unittests/compiler/instruction-sequence-unittest.h" | 7 #include "test/unittests/compiler/instruction-sequence-unittest.h" |
| 8 #include "test/unittests/test-utils.h" | 8 #include "test/unittests/test-utils.h" |
| 9 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 num_double_registers_(kDefaultNRegs), | 48 num_double_registers_(kDefaultNRegs), |
| 49 instruction_blocks_(zone()), | 49 instruction_blocks_(zone()), |
| 50 current_block_(nullptr), | 50 current_block_(nullptr), |
| 51 block_returns_(false) { | 51 block_returns_(false) { |
| 52 InitializeRegisterNames(); | 52 InitializeRegisterNames(); |
| 53 } | 53 } |
| 54 | 54 |
| 55 | 55 |
| 56 void InstructionSequenceTest::SetNumRegs(int num_general_registers, | 56 void InstructionSequenceTest::SetNumRegs(int num_general_registers, |
| 57 int num_double_registers) { | 57 int num_double_registers) { |
| 58 CHECK(config_.is_empty()); | 58 CHECK(!config_); |
| 59 CHECK(instructions_.empty()); | 59 CHECK(instructions_.empty()); |
| 60 CHECK(instruction_blocks_.empty()); | 60 CHECK(instruction_blocks_.empty()); |
| 61 num_general_registers_ = num_general_registers; | 61 num_general_registers_ = num_general_registers; |
| 62 num_double_registers_ = num_double_registers; | 62 num_double_registers_ = num_double_registers; |
| 63 } | 63 } |
| 64 | 64 |
| 65 | 65 |
| 66 RegisterConfiguration* InstructionSequenceTest::config() { | 66 RegisterConfiguration* InstructionSequenceTest::config() { |
| 67 if (config_.is_empty()) { | 67 if (!config_) { |
| 68 config_.Reset(new RegisterConfiguration( | 68 config_.reset(new RegisterConfiguration( |
| 69 num_general_registers_, num_double_registers_, num_general_registers_, | 69 num_general_registers_, num_double_registers_, num_general_registers_, |
| 70 num_double_registers_, allocatable_codes, allocatable_double_codes, | 70 num_double_registers_, allocatable_codes, allocatable_double_codes, |
| 71 kSimpleFPAliasing ? RegisterConfiguration::OVERLAP | 71 kSimpleFPAliasing ? RegisterConfiguration::OVERLAP |
| 72 : RegisterConfiguration::COMBINE, | 72 : RegisterConfiguration::COMBINE, |
| 73 general_register_names_, | 73 general_register_names_, |
| 74 double_register_names_, // float register names | 74 double_register_names_, // float register names |
| 75 double_register_names_, | 75 double_register_names_, |
| 76 double_register_names_)); // SIMD 128 register names | 76 double_register_names_)); // SIMD 128 register names |
| 77 } | 77 } |
| 78 return config_.get(); | 78 return config_.get(); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 | 505 |
| 506 | 506 |
| 507 Instruction* InstructionSequenceTest::AddInstruction(Instruction* instruction) { | 507 Instruction* InstructionSequenceTest::AddInstruction(Instruction* instruction) { |
| 508 sequence()->AddInstruction(instruction); | 508 sequence()->AddInstruction(instruction); |
| 509 return instruction; | 509 return instruction; |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace compiler | 512 } // namespace compiler |
| 513 } // namespace internal | 513 } // namespace internal |
| 514 } // namespace v8 | 514 } // namespace v8 |
| OLD | NEW |