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

Side by Side Diff: src/heap-snapshot-generator.cc

Issue 13786002: [WIP] New GC related APIs. (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: fixed Created 7 years, 8 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 unified diff | Download patch
« src/global-handles.cc ('K') | « src/global-handles.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 1925 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 1936
1937 void NativeObjectsExplorer::FillRetainedObjects() { 1937 void NativeObjectsExplorer::FillRetainedObjects() {
1938 if (embedder_queried_) return; 1938 if (embedder_queried_) return;
1939 Isolate* isolate = Isolate::Current(); 1939 Isolate* isolate = Isolate::Current();
1940 const GCType major_gc_type = kGCTypeMarkSweepCompact; 1940 const GCType major_gc_type = kGCTypeMarkSweepCompact;
1941 // Record objects that are joined into ObjectGroups. 1941 // Record objects that are joined into ObjectGroups.
1942 isolate->heap()->CallGCPrologueCallbacks(major_gc_type); 1942 isolate->heap()->CallGCPrologueCallbacks(major_gc_type);
1943 List<ObjectGroup*>* groups = isolate->global_handles()->object_groups(); 1943 List<ObjectGroup*>* groups = isolate->global_handles()->object_groups();
1944 for (int i = 0; i < groups->length(); ++i) { 1944 for (int i = 0; i < groups->length(); ++i) {
1945 ObjectGroup* group = groups->at(i); 1945 ObjectGroup* group = groups->at(i);
1946 if (group->info_ == NULL) continue; 1946 if (group->info == NULL) {
1947 List<HeapObject*>* list = GetListMaybeDisposeInfo(group->info_); 1947 delete group;
1948 for (size_t j = 0; j < group->length_; ++j) { 1948 continue;
1949 HeapObject* obj = HeapObject::cast(*group->objects_[j]); 1949 }
1950 List<HeapObject*>* list = GetListMaybeDisposeInfo(group->info);
1951 for (int j = 0; j < group->objects.length(); ++j) {
1952 HeapObject* obj = HeapObject::cast(*group->objects[j]);
1950 list->Add(obj); 1953 list->Add(obj);
1951 in_groups_.Insert(obj); 1954 in_groups_.Insert(obj);
1952 } 1955 }
1953 group->info_ = NULL; // Acquire info object ownership. 1956 delete group;
1954 } 1957 }
1958 delete groups;
1955 isolate->global_handles()->RemoveObjectGroups(); 1959 isolate->global_handles()->RemoveObjectGroups();
1956 isolate->heap()->CallGCEpilogueCallbacks(major_gc_type); 1960 isolate->heap()->CallGCEpilogueCallbacks(major_gc_type);
1957 // Record objects that are not in ObjectGroups, but have class ID. 1961 // Record objects that are not in ObjectGroups, but have class ID.
1958 GlobalHandlesExtractor extractor(this); 1962 GlobalHandlesExtractor extractor(this);
1959 isolate->global_handles()->IterateAllRootsWithClassIds(&extractor); 1963 isolate->global_handles()->IterateAllRootsWithClassIds(&extractor);
1960 embedder_queried_ = true; 1964 embedder_queried_ = true;
1961 } 1965 }
1962 1966
1963 void NativeObjectsExplorer::FillImplicitReferences() { 1967 void NativeObjectsExplorer::FillImplicitReferences() {
1964 Isolate* isolate = Isolate::Current(); 1968 Isolate* isolate = Isolate::Current();
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after
2694 2698
2695 2699
2696 void HeapSnapshotJSONSerializer::SortHashMap( 2700 void HeapSnapshotJSONSerializer::SortHashMap(
2697 HashMap* map, List<HashMap::Entry*>* sorted_entries) { 2701 HashMap* map, List<HashMap::Entry*>* sorted_entries) {
2698 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p)) 2702 for (HashMap::Entry* p = map->Start(); p != NULL; p = map->Next(p))
2699 sorted_entries->Add(p); 2703 sorted_entries->Add(p);
2700 sorted_entries->Sort(SortUsingEntryValue); 2704 sorted_entries->Sort(SortUsingEntryValue);
2701 } 2705 }
2702 2706
2703 } } // namespace v8::internal 2707 } } // namespace v8::internal
OLDNEW
« src/global-handles.cc ('K') | « src/global-handles.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698