Index: src/builtins.h |
diff --git a/src/builtins.h b/src/builtins.h |
index dfca7e0ffe04081edd949e3fe442d3830c79a0e1..c1159a8d5252848108340f6844b144a6161cb990 100644 |
--- a/src/builtins.h |
+++ b/src/builtins.h |
@@ -85,8 +85,15 @@ enum BuiltinExtraArguments { |
#define BUILTIN_LIST_A(V) \ |
V(ArgumentsAdaptorTrampoline, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
\ |
- V(CallFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
- V(Call, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
+ V(CallFunction_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
+ kNoExtraICState) \ |
+ V(CallFunction_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
+ kNoExtraICState) \ |
+ V(CallFunction_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
+ V(Call_ReceiverIsNullOrUndefined, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
+ V(Call_ReceiverIsNotNullOrUndefined, BUILTIN, UNINITIALIZED, \ |
+ kNoExtraICState) \ |
+ V(Call_ReceiverIsAny, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
\ |
V(ConstructFunction, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
V(ConstructProxy, BUILTIN, UNINITIALIZED, kNoExtraICState) \ |
@@ -228,6 +235,10 @@ class Builtins { |
#undef DECLARE_BUILTIN_ACCESSOR_C |
#undef DECLARE_BUILTIN_ACCESSOR_A |
+ // Convenience wrappers. |
+ Handle<Code> CallFunction(ConvertReceiverMode = ConvertReceiverMode::kAny); |
+ Handle<Code> Call(ConvertReceiverMode = ConvertReceiverMode::kAny); |
+ |
Code* builtin(Name name) { |
// Code::cast cannot be used here since we access builtins |
// during the marking phase of mark sweep. See IC::Clear. |
@@ -286,9 +297,30 @@ class Builtins { |
static void Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm); |
// ES6 section 9.2.1 [[Call]] ( thisArgument, argumentsList) |
- static void Generate_CallFunction(MacroAssembler* masm); |
+ static void Generate_CallFunction(MacroAssembler* masm, |
+ ConvertReceiverMode mode); |
+ static void Generate_CallFunction_ReceiverIsNullOrUndefined( |
+ MacroAssembler* masm) { |
+ Generate_CallFunction(masm, ConvertReceiverMode::kNullOrUndefined); |
+ } |
+ static void Generate_CallFunction_ReceiverIsNotNullOrUndefined( |
+ MacroAssembler* masm) { |
+ Generate_CallFunction(masm, ConvertReceiverMode::kNotNullOrUndefined); |
+ } |
+ static void Generate_CallFunction_ReceiverIsAny(MacroAssembler* masm) { |
+ Generate_CallFunction(masm, ConvertReceiverMode::kAny); |
+ } |
// ES6 section 7.3.12 Call(F, V, [argumentsList]) |
- static void Generate_Call(MacroAssembler* masm); |
+ static void Generate_Call(MacroAssembler* masm, ConvertReceiverMode mode); |
+ static void Generate_Call_ReceiverIsNullOrUndefined(MacroAssembler* masm) { |
+ Generate_Call(masm, ConvertReceiverMode::kNullOrUndefined); |
+ } |
+ static void Generate_Call_ReceiverIsNotNullOrUndefined(MacroAssembler* masm) { |
+ Generate_Call(masm, ConvertReceiverMode::kNotNullOrUndefined); |
+ } |
+ static void Generate_Call_ReceiverIsAny(MacroAssembler* masm) { |
+ Generate_Call(masm, ConvertReceiverMode::kAny); |
+ } |
// ES6 section 9.2.2 [[Construct]] ( argumentsList, newTarget) |
static void Generate_ConstructFunction(MacroAssembler* masm); |