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

Unified Diff: src/heap.cc

Issue 11953043: Implicit references are missing in heap profiles (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 7 years, 11 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.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.cc
===================================================================
--- src/heap.cc (revision 13485)
+++ src/heap.cc (working copy)
@@ -882,24 +882,13 @@
}
#endif
- if (collector == MARK_COMPACTOR && global_gc_prologue_callback_) {
- ASSERT(!allocation_allowed_);
- GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
- VMState state(isolate_, EXTERNAL);
- global_gc_prologue_callback_();
- }
-
GCType gc_type =
collector == MARK_COMPACTOR ? kGCTypeMarkSweepCompact : kGCTypeScavenge;
{
GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
VMState state(isolate_, EXTERNAL);
- for (int i = 0; i < gc_prologue_callbacks_.length(); ++i) {
- if (gc_type & gc_prologue_callbacks_[i].gc_type) {
- gc_prologue_callbacks_[i].callback(gc_type, kNoGCCallbackFlags);
- }
- }
+ CallGCPrologueCallbacks(gc_type);
}
EnsureFromSpaceIsCommitted();
@@ -1009,21 +998,9 @@
{
GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
VMState state(isolate_, EXTERNAL);
- GCCallbackFlags callback_flags = kNoGCCallbackFlags;
- for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) {
- if (gc_type & gc_epilogue_callbacks_[i].gc_type) {
- gc_epilogue_callbacks_[i].callback(gc_type, callback_flags);
- }
- }
+ CallGCEpilogueCallbacks(gc_type);
}
- if (collector == MARK_COMPACTOR && global_gc_epilogue_callback_) {
- ASSERT(!allocation_allowed_);
- GCTracer::Scope scope(tracer, GCTracer::Scope::EXTERNAL);
- VMState state(isolate_, EXTERNAL);
- global_gc_epilogue_callback_();
- }
-
#ifdef VERIFY_HEAP
if (FLAG_verify_heap) {
VerifySymbolTable();
@@ -1034,6 +1011,30 @@
}
+void Heap::CallGCPrologueCallbacks(GCType gc_type) {
+ if (gc_type == kGCTypeMarkSweepCompact && global_gc_prologue_callback_) {
+ global_gc_prologue_callback_();
+ }
+ for (int i = 0; i < gc_prologue_callbacks_.length(); ++i) {
+ if (gc_type & gc_prologue_callbacks_[i].gc_type) {
+ gc_prologue_callbacks_[i].callback(gc_type, kNoGCCallbackFlags);
+ }
+ }
+}
+
+
+void Heap::CallGCEpilogueCallbacks(GCType gc_type) {
+ for (int i = 0; i < gc_epilogue_callbacks_.length(); ++i) {
+ if (gc_type & gc_epilogue_callbacks_[i].gc_type) {
+ gc_epilogue_callbacks_[i].callback(gc_type, kNoGCCallbackFlags);
+ }
+ }
+ if (gc_type == kGCTypeMarkSweepCompact && global_gc_epilogue_callback_) {
+ global_gc_epilogue_callback_();
+ }
+}
+
+
void Heap::MarkCompact(GCTracer* tracer) {
gc_state_ = MARK_COMPACT;
LOG(isolate_, ResourceEvent("markcompact", "begin"));
@@ -1376,6 +1377,7 @@
new_space_front = DoScavenge(&scavenge_visitor, new_space_front);
}
isolate()->global_handles()->RemoveObjectGroups();
+ isolate()->global_handles()->RemoveImplicitRefGroups();
isolate_->global_handles()->IdentifyNewSpaceWeakIndependentHandles(
&IsUnscavengedHeapObject);
« no previous file with comments | « src/heap.h ('k') | src/profile-generator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698