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

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

Issue 2746013002: [turbofan] Less aggressively insert SOFT deopts for property access. (Closed)
Patch Set: Work-around for JSFunctions without context. Created 3 years, 9 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 | « no previous file | 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 fb8e53b034878cc5ec9d203f2832ad98ae3b9db8..a2fe6c182957661110134a04f28acd06f5df7fab 100644
--- a/src/compiler/js-native-context-specialization.cc
+++ b/src/compiler/js-native-context-specialization.cc
@@ -573,6 +573,7 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccess(
Object* maybe_constructor = receiver_map->GetConstructor();
// Detached global proxies have |null| as their constructor.
if (maybe_constructor->IsJSFunction() &&
+ JSFunction::cast(maybe_constructor)->has_context() &&
JSFunction::cast(maybe_constructor)->native_context() ==
*native_context()) {
return ReduceGlobalAccess(node, receiver, value, name, access_mode,
@@ -799,17 +800,6 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus(
}
}
- // Check if the {nexus} reports type feedback for the IC.
- if (nexus.IsUninitialized()) {
- if ((flags() & kDeoptimizationEnabled) &&
- (flags() & kBailoutOnUninitialized)) {
- return ReduceSoftDeoptimize(
- node,
- DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess);
- }
- return NoChange();
- }
-
// Extract receiver maps from the IC using the {nexus}.
MapHandleList receiver_maps;
if (!ExtractReceiverMaps(receiver, effect, nexus, &receiver_maps)) {
@@ -1194,17 +1184,6 @@ Reduction JSNativeContextSpecialization::ReduceKeyedAccess(
}
}
- // Check if the {nexus} reports type feedback for the IC.
- if (nexus.IsUninitialized()) {
- if ((flags() & kDeoptimizationEnabled) &&
- (flags() & kBailoutOnUninitialized)) {
- return ReduceSoftDeoptimize(
- node,
- DeoptimizeReason::kInsufficientTypeFeedbackForGenericKeyedAccess);
- }
- return NoChange();
- }
-
// Extract receiver maps from the {nexus}.
MapHandleList receiver_maps;
if (!ExtractReceiverMaps(receiver, effect, nexus, &receiver_maps)) {
@@ -2250,7 +2229,10 @@ bool JSNativeContextSpecialization::ExtractReceiverMaps(
}
return true;
}
- return false;
+ // Check if the {nexus} actually reports feedback for the IC. We return
+ // true if the IC is still uninitialized, which translates to a SOFT
+ // deoptimization exit in the callers.
+ return nexus.IsUninitialized();
}
bool JSNativeContextSpecialization::InferReceiverMaps(
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698