Index: src/compiler/js-global-object-specialization.cc |
diff --git a/src/compiler/js-global-object-specialization.cc b/src/compiler/js-global-object-specialization.cc |
index d8c9f17fd4c207737b55780bd1cb9e306572524e..81ea1ad44ba9932a111243a1e66996ad1da0a6b5 100644 |
--- a/src/compiler/js-global-object-specialization.cc |
+++ b/src/compiler/js-global-object-specialization.cc |
@@ -74,6 +74,7 @@ Reduction JSGlobalObjectSpecialization::ReduceJSLoadGlobal(Node* node) { |
// properties of the global object here (represented as PropertyCell). |
LookupIterator it(global_object, name, LookupIterator::OWN); |
if (it.state() != LookupIterator::DATA) return NoChange(); |
+ if (!it.GetHolder<JSObject>()->IsJSGlobalObject()) return NoChange(); |
Handle<PropertyCell> property_cell = it.GetPropertyCell(); |
PropertyDetails property_details = property_cell->property_details(); |
Handle<Object> property_cell_value(property_cell->value(), isolate()); |
@@ -154,6 +155,7 @@ Reduction JSGlobalObjectSpecialization::ReduceJSStoreGlobal(Node* node) { |
// properties of the global object here (represented as PropertyCell). |
LookupIterator it(global_object, name, LookupIterator::OWN); |
if (it.state() != LookupIterator::DATA) return NoChange(); |
+ if (!it.GetHolder<JSObject>()->IsJSGlobalObject()) return NoChange(); |
Handle<PropertyCell> property_cell = it.GetPropertyCell(); |
PropertyDetails property_details = property_cell->property_details(); |
Handle<Object> property_cell_value(property_cell->value(), isolate()); |