Commit a3ea32f6 authored by jochen's avatar jochen Committed by Commit bot

Fix disabling of inlining of API functions for TF with call stats

R=verwaest@chromium.org,epertoso@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2620713003
Cr-Commit-Position: refs/heads/master@{#42180}
parent 6873f14b
...@@ -361,6 +361,7 @@ bool AccessInfoFactory::ComputePropertyAccessInfo( ...@@ -361,6 +361,7 @@ bool AccessInfoFactory::ComputePropertyAccessInfo(
if (optimization.api_call_info()->fast_handler()->IsCode()) { if (optimization.api_call_info()->fast_handler()->IsCode()) {
return false; return false;
} }
if (V8_UNLIKELY(FLAG_runtime_stats)) return false;
} }
*access_info = PropertyAccessInfo::AccessorConstant( *access_info = PropertyAccessInfo::AccessorConstant(
MapList{receiver_map}, accessor, holder); MapList{receiver_map}, accessor, holder);
......
...@@ -1007,7 +1007,14 @@ JSNativeContextSpecialization::BuildPropertyAccess( ...@@ -1007,7 +1007,14 @@ JSNativeContextSpecialization::BuildPropertyAccess(
context, target, frame_state); context, target, frame_state);
// Introduce the call to the getter function. // Introduce the call to the getter function.
if (CanInlineApiCall(access_info)) { if (access_info.constant()->IsJSFunction()) {
value = effect = graph()->NewNode(
javascript()->CallFunction(
2, 0.0f, VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined),
target, receiver, context, frame_state0, effect, control);
control = graph()->NewNode(common()->IfSuccess(), value);
} else {
DCHECK(access_info.constant()->IsFunctionTemplateInfo()); DCHECK(access_info.constant()->IsFunctionTemplateInfo());
Handle<FunctionTemplateInfo> function_template_info( Handle<FunctionTemplateInfo> function_template_info(
Handle<FunctionTemplateInfo>::cast(access_info.constant())); Handle<FunctionTemplateInfo>::cast(access_info.constant()));
...@@ -1018,13 +1025,6 @@ JSNativeContextSpecialization::BuildPropertyAccess( ...@@ -1018,13 +1025,6 @@ JSNativeContextSpecialization::BuildPropertyAccess(
value = value_effect_control.value(); value = value_effect_control.value();
effect = value_effect_control.effect(); effect = value_effect_control.effect();
control = value_effect_control.control(); control = value_effect_control.control();
} else {
value = effect = graph()->NewNode(
javascript()->CallFunction(
2, 0.0f, VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined),
target, receiver, context, frame_state0, effect, control);
control = graph()->NewNode(common()->IfSuccess(), value);
} }
break; break;
} }
...@@ -1044,7 +1044,14 @@ JSNativeContextSpecialization::BuildPropertyAccess( ...@@ -1044,7 +1044,14 @@ JSNativeContextSpecialization::BuildPropertyAccess(
context, target, frame_state); context, target, frame_state);
// Introduce the call to the setter function. // Introduce the call to the setter function.
if (CanInlineApiCall(access_info)) { if (access_info.constant()->IsJSFunction()) {
effect = graph()->NewNode(
javascript()->CallFunction(
3, 0.0f, VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined),
target, receiver, value, context, frame_state0, effect, control);
control = graph()->NewNode(common()->IfSuccess(), effect);
} else {
DCHECK(access_info.constant()->IsFunctionTemplateInfo()); DCHECK(access_info.constant()->IsFunctionTemplateInfo());
Handle<FunctionTemplateInfo> function_template_info( Handle<FunctionTemplateInfo> function_template_info(
Handle<FunctionTemplateInfo>::cast(access_info.constant())); Handle<FunctionTemplateInfo>::cast(access_info.constant()));
...@@ -1055,13 +1062,6 @@ JSNativeContextSpecialization::BuildPropertyAccess( ...@@ -1055,13 +1062,6 @@ JSNativeContextSpecialization::BuildPropertyAccess(
value = value_effect_control.value(); value = value_effect_control.value();
effect = value_effect_control.effect(); effect = value_effect_control.effect();
control = value_effect_control.control(); control = value_effect_control.control();
} else {
effect = graph()->NewNode(
javascript()->CallFunction(
3, 0.0f, VectorSlotPair(),
ConvertReceiverMode::kNotNullOrUndefined),
target, receiver, value, context, frame_state0, effect, control);
control = graph()->NewNode(common()->IfSuccess(), effect);
} }
break; break;
} }
...@@ -1573,13 +1573,6 @@ JSNativeContextSpecialization::BuildElementAccess( ...@@ -1573,13 +1573,6 @@ JSNativeContextSpecialization::BuildElementAccess(
return ValueEffectControl(value, effect, control); return ValueEffectControl(value, effect, control);
} }
bool JSNativeContextSpecialization::CanInlineApiCall(
PropertyAccessInfo const& access_info) {
if (V8_UNLIKELY(FLAG_runtime_stats)) return false;
return access_info.IsAccessorConstant() &&
access_info.constant()->IsFunctionTemplateInfo();
}
JSNativeContextSpecialization::ValueEffectControl JSNativeContextSpecialization::ValueEffectControl
JSNativeContextSpecialization::InlineApiCall( JSNativeContextSpecialization::InlineApiCall(
Node* receiver, Node* context, Node* target, Node* frame_state, Node* value, Node* receiver, Node* context, Node* target, Node* frame_state, Node* value,
......
...@@ -149,7 +149,6 @@ class JSNativeContextSpecialization final : public AdvancedReducer { ...@@ -149,7 +149,6 @@ class JSNativeContextSpecialization final : public AdvancedReducer {
// program location. // program location.
MaybeHandle<Map> InferReceiverRootMap(Node* receiver); MaybeHandle<Map> InferReceiverRootMap(Node* receiver);
bool CanInlineApiCall(PropertyAccessInfo const& access_info);
ValueEffectControl InlineApiCall( ValueEffectControl InlineApiCall(
Node* receiver, Node* context, Node* target, Node* frame_state, Node* receiver, Node* context, Node* target, Node* frame_state,
Node* parameter, Node* effect, Node* control, Node* parameter, Node* effect, Node* control,
......
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