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

Unified Diff: src/heap-snapshot-generator.cc

Issue 1165603002: Starting using GlobalDictionary for global objects instead of NameDictionary. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « src/factory.cc ('k') | src/lookup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-snapshot-generator.cc
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
index 34db11ba5d8f197b01924adea218d5e82c163463..4b3f3be98a20a6b2b109f425b83fe9513b4c7f66 100644
--- a/src/heap-snapshot-generator.cc
+++ b/src/heap-snapshot-generator.cc
@@ -1648,17 +1648,33 @@ void V8HeapExplorer::ExtractPropertyReferences(JSObject* js_obj, int entry) {
break;
}
}
+ } else if (js_obj->IsGlobalObject()) {
+ // We assume that global objects can only have slow properties.
+ GlobalDictionary* dictionary = js_obj->global_dictionary();
+ int length = dictionary->Capacity();
+ for (int i = 0; i < length; ++i) {
+ Object* k = dictionary->KeyAt(i);
+ if (dictionary->IsKey(k)) {
+ Object* target = dictionary->ValueAt(i);
+ DCHECK(target->IsPropertyCell());
+ Object* value = PropertyCell::cast(target)->value();
+ if (k == heap_->hidden_string()) {
+ TagObject(value, "(hidden properties)");
+ SetInternalReference(js_obj, entry, "hidden_properties", value);
+ continue;
+ }
+ PropertyDetails details = dictionary->DetailsAt(i);
+ SetDataOrAccessorPropertyReference(details.kind(), js_obj, entry,
+ Name::cast(k), value);
+ }
+ }
} else {
NameDictionary* dictionary = js_obj->property_dictionary();
int length = dictionary->Capacity();
for (int i = 0; i < length; ++i) {
Object* k = dictionary->KeyAt(i);
if (dictionary->IsKey(k)) {
- Object* target = dictionary->ValueAt(i);
- // We assume that global objects can only have slow properties.
- Object* value = target->IsPropertyCell()
- ? PropertyCell::cast(target)->value()
- : target;
+ Object* value = dictionary->ValueAt(i);
if (k == heap_->hidden_string()) {
TagObject(value, "(hidden properties)");
SetInternalReference(js_obj, entry, "hidden_properties", value);
« no previous file with comments | « src/factory.cc ('k') | src/lookup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698