Index: src/builtins/builtins-interpreter.cc |
diff --git a/src/builtins/builtins-interpreter.cc b/src/builtins/builtins-interpreter.cc |
index 27ef954f17b9994b8e5f11f60105bba13df54503..fe8a1a58ac70f7e70e59c8567cdf1e7afa121fb2 100644 |
--- a/src/builtins/builtins-interpreter.cc |
+++ b/src/builtins/builtins-interpreter.cc |
@@ -8,18 +8,21 @@ |
namespace v8 { |
namespace internal { |
-Handle<Code> Builtins::InterpreterPushArgsAndCall(TailCallMode tail_call_mode, |
- CallableType function_type) { |
- switch (tail_call_mode) { |
- case TailCallMode::kDisallow: |
- if (function_type == CallableType::kJSFunction) { |
+Handle<Code> Builtins::InterpreterPushArgsAndCall( |
+ TailCallMode tail_call_mode, InterpreterPushArgsMode mode) { |
+ switch (mode) { |
+ case InterpreterPushArgsMode::kJSFunction: |
+ if (tail_call_mode == TailCallMode::kDisallow) { |
return InterpreterPushArgsAndCallFunction(); |
} else { |
- return InterpreterPushArgsAndCall(); |
- } |
- case TailCallMode::kAllow: |
- if (function_type == CallableType::kJSFunction) { |
return InterpreterPushArgsAndTailCallFunction(); |
+ } |
+ case InterpreterPushArgsMode::kWithFinalSpread: |
+ CHECK(tail_call_mode == TailCallMode::kDisallow); |
+ return InterpreterPushArgsAndCallWithFinalSpread(); |
+ case InterpreterPushArgsMode::kOther: |
+ if (tail_call_mode == TailCallMode::kDisallow) { |
+ return InterpreterPushArgsAndCall(); |
} else { |
return InterpreterPushArgsAndTailCall(); |
} |
@@ -29,35 +32,41 @@ Handle<Code> Builtins::InterpreterPushArgsAndCall(TailCallMode tail_call_mode, |
} |
void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { |
- return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow, |
- CallableType::kAny); |
+ return Generate_InterpreterPushArgsAndCallImpl( |
+ masm, TailCallMode::kDisallow, InterpreterPushArgsMode::kOther); |
} |
void Builtins::Generate_InterpreterPushArgsAndCallFunction( |
MacroAssembler* masm) { |
- return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kDisallow, |
- CallableType::kJSFunction); |
+ return Generate_InterpreterPushArgsAndCallImpl( |
+ masm, TailCallMode::kDisallow, InterpreterPushArgsMode::kJSFunction); |
+} |
+ |
+void Builtins::Generate_InterpreterPushArgsAndCallWithFinalSpread( |
+ MacroAssembler* masm) { |
+ return Generate_InterpreterPushArgsAndCallImpl( |
+ masm, TailCallMode::kDisallow, InterpreterPushArgsMode::kWithFinalSpread); |
} |
void Builtins::Generate_InterpreterPushArgsAndTailCall(MacroAssembler* masm) { |
- return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
- CallableType::kAny); |
+ return Generate_InterpreterPushArgsAndCallImpl( |
+ masm, TailCallMode::kAllow, InterpreterPushArgsMode::kOther); |
} |
void Builtins::Generate_InterpreterPushArgsAndTailCallFunction( |
MacroAssembler* masm) { |
- return Generate_InterpreterPushArgsAndCallImpl(masm, TailCallMode::kAllow, |
- CallableType::kJSFunction); |
+ return Generate_InterpreterPushArgsAndCallImpl( |
+ masm, TailCallMode::kAllow, InterpreterPushArgsMode::kJSFunction); |
} |
Handle<Code> Builtins::InterpreterPushArgsAndConstruct( |
- PushArgsConstructMode mode) { |
+ InterpreterPushArgsMode mode) { |
switch (mode) { |
- case PushArgsConstructMode::kJSFunction: |
+ case InterpreterPushArgsMode::kJSFunction: |
return InterpreterPushArgsAndConstructFunction(); |
- case PushArgsConstructMode::kWithFinalSpread: |
+ case InterpreterPushArgsMode::kWithFinalSpread: |
return InterpreterPushArgsAndConstructWithFinalSpread(); |
- case PushArgsConstructMode::kOther: |
+ case InterpreterPushArgsMode::kOther: |
return InterpreterPushArgsAndConstruct(); |
} |
UNREACHABLE(); |
@@ -66,19 +75,19 @@ Handle<Code> Builtins::InterpreterPushArgsAndConstruct( |
void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) { |
return Generate_InterpreterPushArgsAndConstructImpl( |
- masm, PushArgsConstructMode::kOther); |
+ masm, InterpreterPushArgsMode::kOther); |
} |
void Builtins::Generate_InterpreterPushArgsAndConstructWithFinalSpread( |
MacroAssembler* masm) { |
return Generate_InterpreterPushArgsAndConstructImpl( |
- masm, PushArgsConstructMode::kWithFinalSpread); |
+ masm, InterpreterPushArgsMode::kWithFinalSpread); |
} |
void Builtins::Generate_InterpreterPushArgsAndConstructFunction( |
MacroAssembler* masm) { |
return Generate_InterpreterPushArgsAndConstructImpl( |
- masm, PushArgsConstructMode::kJSFunction); |
+ masm, InterpreterPushArgsMode::kJSFunction); |
} |
} // namespace internal |