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 3c7aacab15ccb4aed449d724f99d9b31c41f0acb..39f88f806fbaf3c6ae50fafa1aa19507a3941524 100644 |
--- a/src/compiler/js-native-context-specialization.cc |
+++ b/src/compiler/js-native-context-specialization.cc |
@@ -757,11 +757,13 @@ Reduction JSNativeContextSpecialization::ReduceNamedAccessFromNexus( |
Node* const receiver = NodeProperties::GetValueInput(node, 0); |
Node* const effect = NodeProperties::GetEffectInput(node); |
- // Check if we are accessing the current native contexts' global proxy. |
- HeapObjectMatcher m(receiver); |
- if (m.HasValue() && m.Value().is_identical_to(global_proxy())) { |
- // Optimize accesses to the current native contexts' global proxy. |
- return ReduceGlobalAccess(node, nullptr, value, name, access_mode); |
+ if (flags() & kDeoptimizationEnabled) { |
+ // Check if we are accessing the current native contexts' global proxy. |
+ HeapObjectMatcher m(receiver); |
+ if (m.HasValue() && m.Value().is_identical_to(global_proxy())) { |
+ // Optimize accesses to the current native contexts' global proxy. |
+ return ReduceGlobalAccess(node, nullptr, value, name, access_mode); |
+ } |
} |
// Check if the {nexus} reports type feedback for the IC. |