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 #ifndef V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_ | 5 #ifndef V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_ |
6 #define V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_ | 6 #define V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_ |
7 | 7 |
8 #include "src/compiler/instruction.h" | 8 #include "src/compiler/instruction.h" |
9 #include "test/unittests/test-utils.h" | 9 #include "test/unittests/test-utils.h" |
10 #include "testing/gmock/include/gmock/gmock.h" | 10 #include "testing/gmock/include/gmock/gmock.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 } | 119 } |
120 | 120 |
121 InstructionSequenceTest(); | 121 InstructionSequenceTest(); |
122 | 122 |
123 void SetNumRegs(int num_general_registers, int num_double_registers); | 123 void SetNumRegs(int num_general_registers, int num_double_registers); |
124 RegisterConfiguration* config(); | 124 RegisterConfiguration* config(); |
125 InstructionSequence* sequence(); | 125 InstructionSequence* sequence(); |
126 | 126 |
127 void StartLoop(int loop_blocks); | 127 void StartLoop(int loop_blocks); |
128 void EndLoop(); | 128 void EndLoop(); |
129 void StartBlock(); | 129 void StartBlock(bool deferred = false); |
130 Instruction* EndBlock(BlockCompletion completion = FallThrough()); | 130 Instruction* EndBlock(BlockCompletion completion = FallThrough()); |
131 | 131 |
132 TestOperand Imm(int32_t imm = 0); | 132 TestOperand Imm(int32_t imm = 0); |
133 VReg Define(TestOperand output_op); | 133 VReg Define(TestOperand output_op); |
134 VReg Parameter(TestOperand output_op = Reg()) { return Define(output_op); } | 134 VReg Parameter(TestOperand output_op = Reg()) { return Define(output_op); } |
135 | 135 |
136 Instruction* Return(TestOperand input_op_0); | 136 Instruction* Return(TestOperand input_op_0); |
137 Instruction* Return(VReg vreg) { return Return(Reg(vreg, 0)); } | 137 Instruction* Return(VReg vreg) { return Return(Reg(vreg, 0)); } |
138 | 138 |
139 PhiInstruction* Phi(VReg incoming_vreg_0 = VReg(), | 139 PhiInstruction* Phi(VReg incoming_vreg_0 = VReg(), |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 UnallocatedOperand::Lifetime lifetime); | 196 UnallocatedOperand::Lifetime lifetime); |
197 InstructionOperand Unallocated(TestOperand op, | 197 InstructionOperand Unallocated(TestOperand op, |
198 UnallocatedOperand::ExtendedPolicy policy, | 198 UnallocatedOperand::ExtendedPolicy policy, |
199 int index); | 199 int index); |
200 InstructionOperand Unallocated(TestOperand op, | 200 InstructionOperand Unallocated(TestOperand op, |
201 UnallocatedOperand::BasicPolicy policy, | 201 UnallocatedOperand::BasicPolicy policy, |
202 int index); | 202 int index); |
203 InstructionOperand* ConvertInputs(size_t input_size, TestOperand* inputs); | 203 InstructionOperand* ConvertInputs(size_t input_size, TestOperand* inputs); |
204 InstructionOperand ConvertInputOp(TestOperand op); | 204 InstructionOperand ConvertInputOp(TestOperand op); |
205 InstructionOperand ConvertOutputOp(VReg vreg, TestOperand op); | 205 InstructionOperand ConvertOutputOp(VReg vreg, TestOperand op); |
206 InstructionBlock* NewBlock(); | 206 InstructionBlock* NewBlock(bool deferred = false); |
207 void WireBlock(size_t block_offset, int jump_offset); | 207 void WireBlock(size_t block_offset, int jump_offset); |
208 | 208 |
209 Instruction* Emit(InstructionCode code, size_t outputs_size = 0, | 209 Instruction* Emit(InstructionCode code, size_t outputs_size = 0, |
210 InstructionOperand* outputs = nullptr, | 210 InstructionOperand* outputs = nullptr, |
211 size_t inputs_size = 0, | 211 size_t inputs_size = 0, |
212 InstructionOperand* inputs = nullptr, size_t temps_size = 0, | 212 InstructionOperand* inputs = nullptr, size_t temps_size = 0, |
213 InstructionOperand* temps = nullptr, bool is_call = false); | 213 InstructionOperand* temps = nullptr, bool is_call = false); |
214 | 214 |
215 Instruction* AddInstruction(Instruction* instruction); | 215 Instruction* AddInstruction(Instruction* instruction); |
216 | 216 |
(...skipping 18 matching lines...) Expand all Loading... |
235 LoopBlocks loop_blocks_; | 235 LoopBlocks loop_blocks_; |
236 InstructionBlock* current_block_; | 236 InstructionBlock* current_block_; |
237 bool block_returns_; | 237 bool block_returns_; |
238 }; | 238 }; |
239 | 239 |
240 } // namespace compiler | 240 } // namespace compiler |
241 } // namespace internal | 241 } // namespace internal |
242 } // namespace v8 | 242 } // namespace v8 |
243 | 243 |
244 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_ | 244 #endif // V8_UNITTESTS_COMPILER_INSTRUCTION_SEQUENCE_UNITTEST_H_ |
OLD | NEW |