| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 return config()->GetAllocatableFloatCode(index); | 78 return config()->GetAllocatableFloatCode(index); |
| 79 case MachineRepresentation::kFloat64: | 79 case MachineRepresentation::kFloat64: |
| 80 return config()->GetAllocatableDoubleCode(index); | 80 return config()->GetAllocatableDoubleCode(index); |
| 81 case MachineRepresentation::kSimd128: | 81 case MachineRepresentation::kSimd128: |
| 82 return config()->GetAllocatableSimd128Code(index); | 82 return config()->GetAllocatableSimd128Code(index); |
| 83 default: | 83 default: |
| 84 return config()->GetAllocatableGeneralCode(index); | 84 return config()->GetAllocatableGeneralCode(index); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 RegisterConfiguration* InstructionSequenceTest::config() { | 88 const RegisterConfiguration* InstructionSequenceTest::config() { |
| 89 if (!config_) { | 89 if (!config_) { |
| 90 config_.reset(new RegisterConfiguration( | 90 config_.reset(new RegisterConfiguration( |
| 91 num_general_registers_, num_double_registers_, num_general_registers_, | 91 num_general_registers_, num_double_registers_, num_general_registers_, |
| 92 num_double_registers_, allocatable_codes, allocatable_codes, | 92 num_double_registers_, allocatable_codes, allocatable_codes, |
| 93 kSimpleFPAliasing ? RegisterConfiguration::OVERLAP | 93 kSimpleFPAliasing ? RegisterConfiguration::OVERLAP |
| 94 : RegisterConfiguration::COMBINE, | 94 : RegisterConfiguration::COMBINE, |
| 95 general_register_names_, | 95 general_register_names_, |
| 96 double_register_names_, // float register names | 96 double_register_names_, // float register names |
| 97 double_register_names_, | 97 double_register_names_, |
| 98 double_register_names_)); // SIMD 128 register names | 98 double_register_names_)); // SIMD 128 register names |
| 99 } | 99 } |
| 100 return config_.get(); | 100 return config_.get(); |
| 101 } | 101 } |
| 102 | 102 |
| 103 | 103 |
| 104 InstructionSequence* InstructionSequenceTest::sequence() { | 104 InstructionSequence* InstructionSequenceTest::sequence() { |
| 105 if (sequence_ == nullptr) { | 105 if (sequence_ == nullptr) { |
| 106 sequence_ = new (zone()) | 106 sequence_ = new (zone()) |
| 107 InstructionSequence(isolate(), zone(), &instruction_blocks_); | 107 InstructionSequence(isolate(), zone(), &instruction_blocks_); |
| 108 sequence_->SetRegisterConfigurationForTesting( |
| 109 InstructionSequenceTest::config()); |
| 108 } | 110 } |
| 109 return sequence_; | 111 return sequence_; |
| 110 } | 112 } |
| 111 | 113 |
| 112 | 114 |
| 113 void InstructionSequenceTest::StartLoop(int loop_blocks) { | 115 void InstructionSequenceTest::StartLoop(int loop_blocks) { |
| 114 CHECK(current_block_ == nullptr); | 116 CHECK(current_block_ == nullptr); |
| 115 if (!loop_blocks_.empty()) { | 117 if (!loop_blocks_.empty()) { |
| 116 CHECK(!loop_blocks_.back().loop_header_.IsValid()); | 118 CHECK(!loop_blocks_.back().loop_header_.IsValid()); |
| 117 } | 119 } |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 | 557 |
| 556 | 558 |
| 557 Instruction* InstructionSequenceTest::AddInstruction(Instruction* instruction) { | 559 Instruction* InstructionSequenceTest::AddInstruction(Instruction* instruction) { |
| 558 sequence()->AddInstruction(instruction); | 560 sequence()->AddInstruction(instruction); |
| 559 return instruction; | 561 return instruction; |
| 560 } | 562 } |
| 561 | 563 |
| 562 } // namespace compiler | 564 } // namespace compiler |
| 563 } // namespace internal | 565 } // namespace internal |
| 564 } // namespace v8 | 566 } // namespace v8 |
| OLD | NEW |