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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 size_t inputs_size, InstructionOperand** inputs, size_t temps_size, | 286 size_t inputs_size, InstructionOperand** inputs, size_t temps_size, |
287 InstructionOperand** temps) { | 287 InstructionOperand** temps) { |
288 CHECK(current_block_); | 288 CHECK(current_block_); |
289 return Instruction::New(zone(), code, outputs_size, outputs, inputs_size, | 289 return Instruction::New(zone(), code, outputs_size, outputs, inputs_size, |
290 inputs, temps_size, temps); | 290 inputs, temps_size, temps); |
291 } | 291 } |
292 | 292 |
293 | 293 |
294 InstructionOperand* InstructionSequenceTest::Unallocated( | 294 InstructionOperand* InstructionSequenceTest::Unallocated( |
295 TestOperand op, UnallocatedOperand::ExtendedPolicy policy) { | 295 TestOperand op, UnallocatedOperand::ExtendedPolicy policy) { |
296 auto unallocated = new (zone()) UnallocatedOperand(policy); | 296 return new (zone()) UnallocatedOperand(policy, op.vreg_.value_); |
297 unallocated->set_virtual_register(op.vreg_.value_); | |
298 return unallocated; | |
299 } | 297 } |
300 | 298 |
301 | 299 |
302 InstructionOperand* InstructionSequenceTest::Unallocated( | 300 InstructionOperand* InstructionSequenceTest::Unallocated( |
303 TestOperand op, UnallocatedOperand::ExtendedPolicy policy, | 301 TestOperand op, UnallocatedOperand::ExtendedPolicy policy, |
304 UnallocatedOperand::Lifetime lifetime) { | 302 UnallocatedOperand::Lifetime lifetime) { |
305 auto unallocated = new (zone()) UnallocatedOperand(policy, lifetime); | 303 return new (zone()) UnallocatedOperand(policy, lifetime, op.vreg_.value_); |
306 unallocated->set_virtual_register(op.vreg_.value_); | |
307 return unallocated; | |
308 } | 304 } |
309 | 305 |
310 | 306 |
311 InstructionOperand* InstructionSequenceTest::Unallocated( | 307 InstructionOperand* InstructionSequenceTest::Unallocated( |
312 TestOperand op, UnallocatedOperand::ExtendedPolicy policy, int index) { | 308 TestOperand op, UnallocatedOperand::ExtendedPolicy policy, int index) { |
313 auto unallocated = new (zone()) UnallocatedOperand(policy, index); | 309 return new (zone()) UnallocatedOperand(policy, index, op.vreg_.value_); |
314 unallocated->set_virtual_register(op.vreg_.value_); | |
315 return unallocated; | |
316 } | 310 } |
317 | 311 |
318 | 312 |
319 InstructionOperand* InstructionSequenceTest::Unallocated( | 313 InstructionOperand* InstructionSequenceTest::Unallocated( |
320 TestOperand op, UnallocatedOperand::BasicPolicy policy, int index) { | 314 TestOperand op, UnallocatedOperand::BasicPolicy policy, int index) { |
321 auto unallocated = new (zone()) UnallocatedOperand(policy, index); | 315 return new (zone()) UnallocatedOperand(policy, index, op.vreg_.value_); |
322 unallocated->set_virtual_register(op.vreg_.value_); | |
323 return unallocated; | |
324 } | 316 } |
325 | 317 |
326 | 318 |
327 InstructionOperand** InstructionSequenceTest::ConvertInputs( | 319 InstructionOperand** InstructionSequenceTest::ConvertInputs( |
328 size_t input_size, TestOperand* inputs) { | 320 size_t input_size, TestOperand* inputs) { |
329 InstructionOperand** mapped_inputs = | 321 InstructionOperand** mapped_inputs = |
330 zone()->NewArray<InstructionOperand*>(static_cast<int>(input_size)); | 322 zone()->NewArray<InstructionOperand*>(static_cast<int>(input_size)); |
331 for (size_t i = 0; i < input_size; ++i) { | 323 for (size_t i = 0; i < input_size; ++i) { |
332 mapped_inputs[i] = ConvertInputOp(inputs[i]); | 324 mapped_inputs[i] = ConvertInputOp(inputs[i]); |
333 } | 325 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 | 459 |
468 int InstructionSequenceTest::AddInstruction(int instruction_index, | 460 int InstructionSequenceTest::AddInstruction(int instruction_index, |
469 Instruction* instruction) { | 461 Instruction* instruction) { |
470 sequence()->AddInstruction(instruction); | 462 sequence()->AddInstruction(instruction); |
471 return instruction_index; | 463 return instruction_index; |
472 } | 464 } |
473 | 465 |
474 } // namespace compiler | 466 } // namespace compiler |
475 } // namespace internal | 467 } // namespace internal |
476 } // namespace v8 | 468 } // namespace v8 |
OLD | NEW |