OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "test/unittests/compiler/interpreter-assembler-unittest.h" | 5 #include "test/unittests/compiler/interpreter-assembler-unittest.h" |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/compiler/graph.h" | 8 #include "src/compiler/graph.h" |
9 #include "src/compiler/node.h" | 9 #include "src/compiler/node.h" |
10 #include "src/interface-descriptors.h" | 10 #include "src/interface-descriptors.h" |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 EXPECT_EQ(1, end->InputCount()); | 402 EXPECT_EQ(1, end->InputCount()); |
403 Node* tail_call_node = end->InputAt(0); | 403 Node* tail_call_node = end->InputAt(0); |
404 | 404 |
405 EXPECT_THAT(tail_call_node, | 405 EXPECT_THAT(tail_call_node, |
406 IsTailCall(m.call_descriptor(), _, accumulator_value_2, _, _, _, | 406 IsTailCall(m.call_descriptor(), _, accumulator_value_2, _, _, _, |
407 _, _, _)); | 407 _, _, _)); |
408 } | 408 } |
409 } | 409 } |
410 | 410 |
411 | 411 |
| 412 TARGET_TEST_F(InterpreterAssemblerTest, GetSetContext) { |
| 413 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
| 414 InterpreterAssemblerForTest m(this, bytecode); |
| 415 Node* context_node = m.Int32Constant(100); |
| 416 m.SetContext(context_node); |
| 417 EXPECT_THAT(m.GetContext(), context_node); |
| 418 } |
| 419 } |
| 420 |
| 421 |
412 TARGET_TEST_F(InterpreterAssemblerTest, RegisterLocation) { | 422 TARGET_TEST_F(InterpreterAssemblerTest, RegisterLocation) { |
413 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 423 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
414 InterpreterAssemblerForTest m(this, bytecode); | 424 InterpreterAssemblerForTest m(this, bytecode); |
415 Node* reg_index_node = m.Int32Constant(44); | 425 Node* reg_index_node = m.Int32Constant(44); |
416 Node* reg_location_node = m.RegisterLocation(reg_index_node); | 426 Node* reg_location_node = m.RegisterLocation(reg_index_node); |
417 EXPECT_THAT( | 427 EXPECT_THAT( |
418 reg_location_node, | 428 reg_location_node, |
419 IsIntPtrAdd( | 429 IsIntPtrAdd( |
420 IsParameter(Linkage::kInterpreterRegisterFileParameter), | 430 IsParameter(Linkage::kInterpreterRegisterFileParameter), |
421 IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)))); | 431 IsWordShl(reg_index_node, IsInt32Constant(kPointerSizeLog2)))); |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 feedback_vector, | 692 feedback_vector, |
683 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, | 693 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, |
684 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 694 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
685 kHeapObjectTag))); | 695 kHeapObjectTag))); |
686 } | 696 } |
687 } | 697 } |
688 | 698 |
689 } // namespace compiler | 699 } // namespace compiler |
690 } // namespace internal | 700 } // namespace internal |
691 } // namespace v8 | 701 } // namespace v8 |
OLD | NEW |