Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Unified Diff: src/compiler/js-native-context-specialization.cc

Issue 2620713003: Fix disabling of inlining of API functions for TF with call stats (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/js-native-context-specialization.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/js-native-context-specialization.cc
diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
index 76eed6554f4c3e1eadd8702d7016c2e55fb519a1..76814f5e55eec457e74727017c12a33169ca475a 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -1007,7 +1007,14 @@ JSNativeContextSpecialization::BuildPropertyAccess(
context, target, frame_state);
// 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());
Handle<FunctionTemplateInfo> function_template_info(
Handle<FunctionTemplateInfo>::cast(access_info.constant()));
@@ -1018,13 +1025,6 @@ JSNativeContextSpecialization::BuildPropertyAccess(
value = value_effect_control.value();
effect = value_effect_control.effect();
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;
}
@@ -1044,7 +1044,14 @@ JSNativeContextSpecialization::BuildPropertyAccess(
context, target, frame_state);
// 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());
Handle<FunctionTemplateInfo> function_template_info(
Handle<FunctionTemplateInfo>::cast(access_info.constant()));
@@ -1055,13 +1062,6 @@ JSNativeContextSpecialization::BuildPropertyAccess(
value = value_effect_control.value();
effect = value_effect_control.effect();
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;
}
@@ -1573,13 +1573,6 @@ JSNativeContextSpecialization::BuildElementAccess(
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::InlineApiCall(
Node* receiver, Node* context, Node* target, Node* frame_state, Node* value,
« no previous file with comments | « src/compiler/js-native-context-specialization.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698