OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "src/builtins/builtins.h" |
| 6 #include "src/builtins/builtins-utils.h" |
| 7 |
| 8 namespace v8 { |
| 9 namespace internal { |
| 10 |
| 11 Handle<Code> Builtins::InterpreterPushArgsAndCall(TailCallMode tail_call_mode, |
| 12 CallableType function_type) { |
| 13 switch (tail_call_mode) { |
| 14 case TailCallMode::kDisallow: |
| 15 if (function_type == CallableType::kJSFunction) { |
| 16 return InterpreterPushArgsAndCallFunction(); |
| 17 } else { |
| 18 return InterpreterPushArgsAndCall(); |
| 19 } |
| 20 case TailCallMode::kAllow: |
| 21 if (function_type == CallableType::kJSFunction) { |
| 22 return InterpreterPushArgsAndTailCallFunction(); |
| 23 } else { |
| 24 return InterpreterPushArgsAndTailCall(); |
| 25 } |
| 26 } |
| 27 UNREACHABLE(); |
| 28 return Handle<Code>::null(); |
| 29 } |
| 30 |
| 31 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
| 32 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow, |
| 33 CallableType::kAny); |
| 34 } |
| 35 |
| 36 void Builtins::Generate_InterpreterPushArgsAndCallFunction( |
| 37 MacroAssembler* masm) { |
| 38 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow, |
| 39 CallableType::kJSFunction); |
| 40 } |
| 41 |
| 42 void Builtins::Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { |
| 43 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
| 44 CallableType::kAny); |
| 45 } |
| 46 |
| 47 void Builtins::Generate_InterpreterPushArgsAndTailCallFunction( |
| 48 MacroAssembler* masm) { |
| 49 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
| 50 CallableType::kJSFunction); |
| 51 } |
| 52 |
| 53 } // namespace internal |
| 54 } // namespace v8 |
OLD | NEW |