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

Unified Diff: src/objects.cc

Issue 1218783005: Support for global var shortcuts in script contexts. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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
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());

Powered by Google App Engine
This is Rietveld 408576698