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

Side by Side Diff: runtime/vm/gc_marker.cc

Issue 197963002: Remove the ability to allow multiple gc prologue and gc epilogue callbacks (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/gc_marker.h" 5 #include "vm/gc_marker.h"
6 6
7 #include <map> 7 #include <map>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 handle->UpdateUnreachable(isolate(), is_prologue_weak); 309 handle->UpdateUnreachable(isolate(), is_prologue_weak);
310 } 310 }
311 } 311 }
312 312
313 private: 313 private:
314 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor); 314 DISALLOW_COPY_AND_ASSIGN(MarkingWeakVisitor);
315 }; 315 };
316 316
317 317
318 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) { 318 void GCMarker::Prologue(Isolate* isolate, bool invoke_api_callbacks) {
319 if (invoke_api_callbacks) { 319 if (invoke_api_callbacks && (isolate->gc_prologue_callback() != NULL)) {
320 isolate->gc_prologue_callbacks().Invoke(); 320 (isolate->gc_prologue_callback())();
321 } 321 }
322 // The store buffers will be rebuilt as part of marking, reset them now. 322 // The store buffers will be rebuilt as part of marking, reset them now.
323 isolate->store_buffer()->Reset(); 323 isolate->store_buffer()->Reset();
324 } 324 }
325 325
326 326
327 void GCMarker::Epilogue(Isolate* isolate, bool invoke_api_callbacks) { 327 void GCMarker::Epilogue(Isolate* isolate, bool invoke_api_callbacks) {
328 if (invoke_api_callbacks) { 328 if (invoke_api_callbacks && (isolate->gc_epilogue_callback() != NULL)) {
329 isolate->gc_epilogue_callbacks().Invoke(); 329 (isolate->gc_epilogue_callback())();
330 } 330 }
331 } 331 }
332 332
333 333
334 void GCMarker::IterateRoots(Isolate* isolate, 334 void GCMarker::IterateRoots(Isolate* isolate,
335 ObjectPointerVisitor* visitor, 335 ObjectPointerVisitor* visitor,
336 bool visit_prologue_weak_persistent_handles) { 336 bool visit_prologue_weak_persistent_handles) {
337 isolate->VisitObjectPointers(visitor, 337 isolate->VisitObjectPointers(visitor,
338 visit_prologue_weak_persistent_handles, 338 visit_prologue_weak_persistent_handles,
339 StackFrameIterator::kDontValidateFrames); 339 StackFrameIterator::kDontValidateFrames);
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 MarkingWeakVisitor mark_weak; 497 MarkingWeakVisitor mark_weak;
498 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); 498 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks);
499 mark.Finalize(); 499 mark.Finalize();
500 ProcessWeakTables(page_space); 500 ProcessWeakTables(page_space);
501 ProcessObjectIdTable(isolate); 501 ProcessObjectIdTable(isolate);
502 502
503 Epilogue(isolate, invoke_api_callbacks); 503 Epilogue(isolate, invoke_api_callbacks);
504 } 504 }
505 505
506 } // namespace dart 506 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698