Index: src/compiler/js-typed-lowering.cc |
diff --git a/src/compiler/js-typed-lowering.cc b/src/compiler/js-typed-lowering.cc |
index b184797ddabd312564413200636cabc30f4e1637..62861b3c1c70cd3d82fa1a14a464e5d186ad684c 100644 |
--- a/src/compiler/js-typed-lowering.cc |
+++ b/src/compiler/js-typed-lowering.cc |
@@ -1598,7 +1598,10 @@ Reduction JSTypedLowering::ReduceJSCallConstruct(Node* node) { |
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; |
- if (is_builtin && Builtins::HasCppImplementation(builtin_index)) { |
+ if (is_builtin && Builtins::HasCppImplementation(builtin_index) && |
+ (shared->internal_formal_parameter_count() == arity || |
+ shared->internal_formal_parameter_count() == |
+ SharedFunctionInfo::kDontAdaptArgumentsSentinel)) { |
// Patch {node} to a direct CEntryStub call. |
// Load the context from the {target}. |
@@ -1710,7 +1713,10 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) { |
Node* new_target = jsgraph()->UndefinedConstant(); |
Node* argument_count = jsgraph()->Int32Constant(arity); |
- if (is_builtin && Builtins::HasCppImplementation(builtin_index)) { |
+ if (is_builtin && Builtins::HasCppImplementation(builtin_index) && |
+ (shared->internal_formal_parameter_count() == arity || |
+ shared->internal_formal_parameter_count() == |
+ SharedFunctionInfo::kDontAdaptArgumentsSentinel)) { |
// Patch {node} to a direct CEntryStub call. |
ReduceBuiltin(isolate(), jsgraph(), node, builtin_index, arity, flags); |
} else if (shared->internal_formal_parameter_count() == arity || |