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 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 _, code_target_matcher, | 375 _, code_target_matcher, |
376 IsParameter(InterpreterDispatchDescriptor::kAccumulatorParameter), | 376 IsParameter(InterpreterDispatchDescriptor::kAccumulatorParameter), |
377 next_bytecode_offset_matcher, _, | 377 next_bytecode_offset_matcher, _, |
378 IsParameter( | 378 IsParameter( |
379 InterpreterDispatchDescriptor::kDispatchTableParameter), | 379 InterpreterDispatchDescriptor::kDispatchTableParameter), |
380 _, _)); | 380 _, _)); |
381 } | 381 } |
382 } | 382 } |
383 } | 383 } |
384 | 384 |
385 TARGET_TEST_F(InterpreterAssemblerTest, InterpreterReturn) { | |
386 // If debug code is enabled we emit extra code in InterpreterReturn. | |
387 if (FLAG_debug_code) return; | |
388 | |
389 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | |
390 InterpreterAssemblerForTest m(this, bytecode); | |
391 Node* tail_call_node = m.InterpreterReturn(); | |
392 | |
393 Handle<HeapObject> exit_trampoline = | |
394 isolate()->builtins()->InterpreterExitTrampoline(); | |
395 Matcher<Node*> exit_trampoline_entry_matcher = | |
396 IsIntPtrAdd(IsHeapConstant(exit_trampoline), | |
397 IsIntPtrConstant(Code::kHeaderSize - kHeapObjectTag)); | |
398 EXPECT_THAT( | |
399 tail_call_node, | |
400 IsTailCall( | |
401 _, exit_trampoline_entry_matcher, | |
402 IsParameter(InterpreterDispatchDescriptor::kAccumulatorParameter), | |
403 IsParameter( | |
404 InterpreterDispatchDescriptor::kBytecodeOffsetParameter), | |
405 _, | |
406 IsParameter(InterpreterDispatchDescriptor::kDispatchTableParameter), | |
407 _, _)); | |
408 } | |
409 } | |
410 | |
411 TARGET_TEST_F(InterpreterAssemblerTest, BytecodeOperand) { | 385 TARGET_TEST_F(InterpreterAssemblerTest, BytecodeOperand) { |
412 static const OperandScale kOperandScales[] = { | 386 static const OperandScale kOperandScales[] = { |
413 OperandScale::kSingle, OperandScale::kDouble, OperandScale::kQuadruple}; | 387 OperandScale::kSingle, OperandScale::kDouble, OperandScale::kQuadruple}; |
414 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { | 388 TRACED_FOREACH(interpreter::Bytecode, bytecode, kBytecodes) { |
415 TRACED_FOREACH(interpreter::OperandScale, operand_scale, kOperandScales) { | 389 TRACED_FOREACH(interpreter::OperandScale, operand_scale, kOperandScales) { |
416 InterpreterAssemblerForTest m(this, bytecode, operand_scale); | 390 InterpreterAssemblerForTest m(this, bytecode, operand_scale); |
417 int number_of_operands = | 391 int number_of_operands = |
418 interpreter::Bytecodes::NumberOfOperands(bytecode); | 392 interpreter::Bytecodes::NumberOfOperands(bytecode); |
419 for (int i = 0; i < number_of_operands; i++) { | 393 for (int i = 0; i < number_of_operands; i++) { |
420 int offset = interpreter::Bytecodes::GetOperandOffset(bytecode, i, | 394 int offset = interpreter::Bytecodes::GetOperandOffset(bytecode, i, |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 feedback_vector, | 701 feedback_vector, |
728 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, | 702 m.IsLoad(MachineType::AnyTagged(), load_shared_function_info_matcher, |
729 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - | 703 IsIntPtrConstant(SharedFunctionInfo::kFeedbackVectorOffset - |
730 kHeapObjectTag))); | 704 kHeapObjectTag))); |
731 } | 705 } |
732 } | 706 } |
733 | 707 |
734 } // namespace interpreter | 708 } // namespace interpreter |
735 } // namespace internal | 709 } // namespace internal |
736 } // namespace v8 | 710 } // namespace v8 |
OLD | NEW |