Commit be23ef54 authored by jgruber's avatar jgruber Committed by Commit bot

[turbofan] Disable inlining of Cpp builtins in need of argument adaption

Disable inlining of Cpp to a direct CEntryStub call when a call would
require argument adaption, i.e. when argument adaption is enabled for
the given function and the actual argument count differs from the formal
parameter count.

This is intended to be a temporary fix until we either disable argument
adaption for all Cpp builtins or add adaption logic to inlined Cpp
builtins.

BUG=chromium:639752

Review-Url: https://codereview.chromium.org/2266893002
Cr-Commit-Position: refs/heads/master@{#38788}
parent 81ab165d
...@@ -1598,7 +1598,10 @@ Reduction JSTypedLowering::ReduceJSCallConstruct(Node* node) { ...@@ -1598,7 +1598,10 @@ Reduction JSTypedLowering::ReduceJSCallConstruct(Node* node) {
CallDescriptor::Flags flags = CallDescriptor::kNeedsFrameState; 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. // Patch {node} to a direct CEntryStub call.
// Load the context from the {target}. // Load the context from the {target}.
...@@ -1710,7 +1713,10 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) { ...@@ -1710,7 +1713,10 @@ Reduction JSTypedLowering::ReduceJSCallFunction(Node* node) {
Node* new_target = jsgraph()->UndefinedConstant(); Node* new_target = jsgraph()->UndefinedConstant();
Node* argument_count = jsgraph()->Int32Constant(arity); 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. // Patch {node} to a direct CEntryStub call.
ReduceBuiltin(isolate(), jsgraph(), node, builtin_index, arity, flags); ReduceBuiltin(isolate(), jsgraph(), node, builtin_index, arity, flags);
} else if (shared->internal_formal_parameter_count() == arity || } else if (shared->internal_formal_parameter_count() == arity ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment