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/interpreter/interpreter-assembler-unittest.h" | 5 #include "test/unittests/interpreter/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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 InterpreterAssemblerForTest m(this, bytecode); | 457 InterpreterAssemblerForTest m(this, bytecode); |
458 m.InterpreterReturn(); | 458 m.InterpreterReturn(); |
459 Graph* graph = m.graph(); | 459 Graph* graph = m.graph(); |
460 | 460 |
461 Node* end = graph->end(); | 461 Node* end = graph->end(); |
462 EXPECT_EQ(1, end->InputCount()); | 462 EXPECT_EQ(1, end->InputCount()); |
463 Node* tail_call_node = end->InputAt(0); | 463 Node* tail_call_node = end->InputAt(0); |
464 | 464 |
465 Handle<HeapObject> exit_trampoline = | 465 Handle<HeapObject> exit_trampoline = |
466 isolate()->builtins()->InterpreterExitTrampoline(); | 466 isolate()->builtins()->InterpreterExitTrampoline(); |
| 467 Matcher<Node*> exit_trampoline_entry_matcher = |
| 468 IsIntPtrAdd(IsHeapConstant(exit_trampoline), |
| 469 IsIntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); |
467 EXPECT_THAT( | 470 EXPECT_THAT( |
468 tail_call_node, | 471 tail_call_node, |
469 IsTailCall( | 472 IsTailCall( |
470 _, IsHeapConstant(exit_trampoline), | 473 _, exit_trampoline_entry_matcher, |
471 IsParameter(InterpreterDispatchDescriptor::kAccumulatorParameter), | 474 IsParameter(InterpreterDispatchDescriptor::kAccumulatorParameter), |
472 IsParameter(InterpreterDispatchDescriptor::kRegisterFileParameter), | 475 IsParameter(InterpreterDispatchDescriptor::kRegisterFileParameter), |
473 IsParameter( | 476 IsParameter( |
474 InterpreterDispatchDescriptor::kBytecodeOffsetParameter), | 477 InterpreterDispatchDescriptor::kBytecodeOffsetParameter), |
475 _, | 478 _, |
476 IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), | 479 IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), |
477 IsParameter(InterpreterDispatchDescriptor::kContextParameter), _, | 480 IsParameter(InterpreterDispatchDescriptor::kContextParameter), _, |
478 _)); | 481 _)); |
479 } | 482 } |
480 } | 483 } |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 feedback_vector, | 822 feedback_vector, |
820 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, | 823 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, |
821 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 824 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
822 kHeapObjectTag))); | 825 kHeapObjectTag))); |
823 } | 826 } |
824 } | 827 } |
825 | 828 |
826 } // namespace interpreter | 829 } // namespace interpreter |
827 } // namespace internal | 830 } // namespace internal |
828 } // namespace v8 | 831 } // namespace v8 |
OLD | NEW |