| OLD | NEW |
| 1 // Copyright 2016 the V8 project authors. All rights reserved. | 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 | 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 "src/builtins/builtins.h" | 5 #include "src/builtins/builtins.h" |
| 6 #include "src/builtins/builtins-utils.h" | 6 #include "src/builtins/builtins-utils.h" |
| 7 | 7 |
| 8 namespace v8 { | 8 namespace v8 { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 CallableType::kAny); | 44 CallableType::kAny); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void Builtins::Generate_InterpreterPushArgsAndTailCallFunction( | 47 void Builtins::Generate_InterpreterPushArgsAndTailCallFunction( |
| 48 MacroAssembler* masm) { | 48 MacroAssembler* masm) { |
| 49 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, | 49 return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
| 50 CallableType::kJSFunction); | 50 CallableType::kJSFunction); |
| 51 } | 51 } |
| 52 | 52 |
| 53 Handle<Code> Builtins::InterpreterPushArgsAndConstruct( | 53 Handle<Code> Builtins::InterpreterPushArgsAndConstruct( |
| 54 CallableType function_type) { | 54 PushArgsConstructMode mode) { |
| 55 switch (function_type) { | 55 switch (mode) { |
| 56 case CallableType::kJSFunction: | 56 case PushArgsConstructMode::kJSFunction: |
| 57 return InterpreterPushArgsAndConstructFunction(); | 57 return InterpreterPushArgsAndConstructFunction(); |
| 58 case CallableType::kAny: | 58 case PushArgsConstructMode::kWithFinalSpread: |
| 59 return InterpreterPushArgsAndConstructWithFinalSpread(); |
| 60 case PushArgsConstructMode::kOther: |
| 59 return InterpreterPushArgsAndConstruct(); | 61 return InterpreterPushArgsAndConstruct(); |
| 60 } | 62 } |
| 61 UNREACHABLE(); | 63 UNREACHABLE(); |
| 62 return Handle<Code>::null(); | 64 return Handle<Code>::null(); |
| 63 } | 65 } |
| 64 | 66 |
| 65 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { | 67 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
| 66 return Generate_InterpreterPushArgsAndConstructImpl(masm, CallableType::kAny); | 68 return Generate_InterpreterPushArgsAndConstructImpl( |
| 69 masm, PushArgsConstructMode::kOther); |
| 70 } |
| 71 |
| 72 void Builtins::Generate_InterpreterPushArgsAndConstructWithFinalSpread( |
| 73 MacroAssembler* masm) { |
| 74 return Generate_InterpreterPushArgsAndConstructImpl( |
| 75 masm, PushArgsConstructMode::kWithFinalSpread); |
| 67 } | 76 } |
| 68 | 77 |
| 69 void Builtins::Generate_InterpreterPushArgsAndConstructFunction( | 78 void Builtins::Generate_InterpreterPushArgsAndConstructFunction( |
| 70 MacroAssembler* masm) { | 79 MacroAssembler* masm) { |
| 71 return Generate_InterpreterPushArgsAndConstructImpl( | 80 return Generate_InterpreterPushArgsAndConstructImpl( |
| 72 masm, CallableType::kJSFunction); | 81 masm, PushArgsConstructMode::kJSFunction); |
| 73 } | 82 } |
| 74 | 83 |
| 75 } // namespace internal | 84 } // namespace internal |
| 76 } // namespace v8 | 85 } // namespace v8 |
| OLD | NEW |