Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 4c72aa9d6c5e60723e931762a8b20804fd6e30b2..198e501e6efaa2898ac8fbf6e55584104828ee16 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -1802,9 +1802,21 @@ void JSObject::MigrateToMap(Handle<JSObject> object, Handle<Map> new_map, |
DCHECK(new_map->GetBackPointer()->IsUndefined()); |
} |
} else { |
+ DCHECK(!object->IsGlobalObject()); |
MigrateFastToSlow(object, new_map, expected_additional_properties); |
} |
} else { |
+ if (object->IsGlobalObject()) { |
Toon Verwaest
2015/07/01 09:28:55
What case is this needed for?
Add a comment at lea
Igor Sheludko
2015/07/02 16:50:13
Done.
|
+ Handle<Context> native_context( |
+ GlobalObject::cast(*object)->native_context()); |
+ Handle<ScriptContextTable> script_contexts( |
+ native_context->script_context_table()); |
+ for (int i = 0; i < script_contexts->used(); i++) { |
+ Handle<Context> context = |
+ ScriptContextTable::GetContext(script_contexts, i); |
+ context->InvalidateGlobalSlots(); |
+ } |
+ } |
// For slow-to-fast migrations JSObject::MigrateSlowToFast() |
// must be used instead. |
CHECK(new_map->is_dictionary_map()); |