| 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/node.h" | 8 #include "src/compiler/node.h" |
| 9 #include "src/interface-descriptors.h" | 9 #include "src/interface-descriptors.h" |
| 10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
| (...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 } | 685 } |
| 686 } | 686 } |
| 687 | 687 |
| 688 TARGET_TEST_F(InterpreterAssemblerTest, CallJS) { | 688 TARGET_TEST_F(InterpreterAssemblerTest, CallJS) { |
| 689 TailCallMode tail_call_modes[] = {TailCallMode::kDisallow, | 689 TailCallMode tail_call_modes[] = {TailCallMode::kDisallow, |
| 690 TailCallMode::kAllow}; | 690 TailCallMode::kAllow}; |
| 691 TRACED_FOREACH(TailCallMode, tail_call_mode, tail_call_modes) { | 691 TRACED_FOREACH(TailCallMode, tail_call_mode, tail_call_modes) { |
| 692 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 692 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
| 693 InterpreterAssemblerTestState state(this, bytecode); | 693 InterpreterAssemblerTestState state(this, bytecode); |
| 694 InterpreterAssemblerForTest m(&state, bytecode); | 694 InterpreterAssemblerForTest m(&state, bytecode); |
| 695 Callable builtin = | 695 Callable builtin = CodeFactory::InterpreterPushArgsAndCall( |
| 696 CodeFactory::InterpreterPushArgsAndCall(isolate(), tail_call_mode); | 696 isolate(), tail_call_mode, InterpreterPushArgsMode::kOther); |
| 697 Node* function = m.IntPtrConstant(0); | 697 Node* function = m.IntPtrConstant(0); |
| 698 Node* first_arg = m.IntPtrConstant(1); | 698 Node* first_arg = m.IntPtrConstant(1); |
| 699 Node* arg_count = m.Int32Constant(2); | 699 Node* arg_count = m.Int32Constant(2); |
| 700 Node* context = m.IntPtrConstant(3); | 700 Node* context = m.IntPtrConstant(3); |
| 701 Node* call_js = | 701 Node* call_js = |
| 702 m.CallJS(function, context, first_arg, arg_count, tail_call_mode); | 702 m.CallJS(function, context, first_arg, arg_count, tail_call_mode); |
| 703 EXPECT_THAT(call_js, IsCall(_, IsHeapConstant(builtin.code()), arg_count, | 703 EXPECT_THAT(call_js, IsCall(_, IsHeapConstant(builtin.code()), arg_count, |
| 704 first_arg, function, context, _, _)); | 704 first_arg, function, context, _, _)); |
| 705 } | 705 } |
| 706 } | 706 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 723 EXPECT_THAT(feedback_vector, | 723 EXPECT_THAT(feedback_vector, |
| 724 m.IsLoad(MachineType::AnyTagged(), load_literals_matcher, | 724 m.IsLoad(MachineType::AnyTagged(), load_literals_matcher, |
| 725 IsIntPtrConstant(LiteralsArray::kFeedbackVectorOffset - | 725 IsIntPtrConstant(LiteralsArray::kFeedbackVectorOffset - |
| 726 kHeapObjectTag))); | 726 kHeapObjectTag))); |
| 727 } | 727 } |
| 728 } | 728 } |
| 729 | 729 |
| 730 } // namespace interpreter | 730 } // namespace interpreter |
| 731 } // namespace internal | 731 } // namespace internal |
| 732 } // namespace v8 | 732 } // namespace v8 |
| OLD | NEW |