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

Unified Diff: runtime/vm/gc_marker.cc

Issue 9605033: Implement a garbage collection prologue and epilogue callback mechanism. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix a comment Created 8 years, 9 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
« runtime/vm/dart_api_state.h ('K') | « runtime/vm/gc_marker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/gc_marker.cc
diff --git a/runtime/vm/gc_marker.cc b/runtime/vm/gc_marker.cc
index f2c2a07bc55f32fa6f2f79dcf62bd7908750ffc6..d6f50a2783ef738ebe1b6998d6cea593102a4878 100644
--- a/runtime/vm/gc_marker.cc
+++ b/runtime/vm/gc_marker.cc
@@ -219,7 +219,18 @@ class MarkingWeakVisitor : public HandleVisitor {
void GCMarker::Prologue(Isolate* isolate) {
- // Nothing to do at the moment.
+ // Always invoke the prologue callbacks.
+ ApiState* state = isolate->api_state();
+ ASSERT(state != NULL);
+ state->gc_prologue_callbacks().Invoke();
+}
+
+
+void GCMarker::Epilogue(Isolate* isolate) {
+ // Always invoke the epilogue callbacks.
+ ApiState* state = isolate->api_state();
+ ASSERT(state != NULL);
+ state->gc_epilogue_callbacks().Invoke();
}
@@ -305,6 +316,7 @@ void GCMarker::MarkObjects(Isolate* isolate, PageSpace* page_space) {
IterateWeakReferences(isolate, &mark);
MarkingWeakVisitor mark_weak;
IterateWeakRoots(isolate, &mark_weak);
+ Epilogue(isolate);
}
} // namespace dart
« runtime/vm/dart_api_state.h ('K') | « runtime/vm/gc_marker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698