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

Unified Diff: src/log.cc

Issue 2020363002: Revert of [heap] Do not invoke GC to make heap iterable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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/heap/heap.cc ('k') | src/profiler/heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/log.cc
diff --git a/src/log.cc b/src/log.cc
index 49fd10ae581e5335622479ea7050ada08ff88faf..886ddedd6ed491ecf67b9e3fc5579fba3fafe446 100644
--- a/src/log.cc
+++ b/src/log.cc
@@ -1565,6 +1565,8 @@
void Logger::LogCodeObjects() {
Heap* heap = isolate_->heap();
+ heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
+ "Logger::LogCodeObjects");
HeapIterator iterator(heap);
DisallowHeapAllocation no_gc;
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
@@ -1648,12 +1650,13 @@
void Logger::LogCompiledFunctions() {
Heap* heap = isolate_->heap();
+ heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
+ "Logger::LogCompiledFunctions");
HandleScope scope(isolate_);
- int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL);
+ const int compiled_funcs_count = EnumerateCompiledFunctions(heap, NULL, NULL);
ScopedVector< Handle<SharedFunctionInfo> > sfis(compiled_funcs_count);
ScopedVector<Handle<AbstractCode> > code_objects(compiled_funcs_count);
- compiled_funcs_count =
- EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start());
+ EnumerateCompiledFunctions(heap, sfis.start(), code_objects.start());
// During iteration, there can be heap allocation due to
// GetScriptLineNumber call.
@@ -1667,6 +1670,8 @@
void Logger::LogAccessorCallbacks() {
Heap* heap = isolate_->heap();
+ heap->CollectAllGarbage(Heap::kMakeHeapIterableMask,
+ "Logger::LogAccessorCallbacks");
HeapIterator iterator(heap);
DisallowHeapAllocation no_gc;
for (HeapObject* obj = iterator.next(); obj != NULL; obj = iterator.next()) {
« no previous file with comments | « src/heap/heap.cc ('k') | src/profiler/heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698