OLD | NEW |
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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 524 |
525 void GCMarker::MarkObjects(Isolate* isolate, | 525 void GCMarker::MarkObjects(Isolate* isolate, |
526 PageSpace* page_space, | 526 PageSpace* page_space, |
527 bool invoke_api_callbacks, | 527 bool invoke_api_callbacks, |
528 bool collect_code) { | 528 bool collect_code) { |
529 const bool visit_function_code = !collect_code; | 529 const bool visit_function_code = !collect_code; |
530 Prologue(isolate, invoke_api_callbacks); | 530 Prologue(isolate, invoke_api_callbacks); |
531 // The API prologue/epilogue may create/destroy zones, so we must not | 531 // The API prologue/epilogue may create/destroy zones, so we must not |
532 // depend on zone allocations surviving beyond the epilogue callback. | 532 // depend on zone allocations surviving beyond the epilogue callback. |
533 { | 533 { |
534 StackZone zone(isolate); | 534 StackZone zone(Thread::Current()); |
535 MarkingStack marking_stack; | 535 MarkingStack marking_stack; |
536 DelaySet delay_set; | 536 DelaySet delay_set; |
537 MarkingVisitor mark(isolate, heap_, page_space, &marking_stack, | 537 MarkingVisitor mark(isolate, heap_, page_space, &marking_stack, |
538 &delay_set, visit_function_code); | 538 &delay_set, visit_function_code); |
539 IterateRoots(isolate, &mark, !invoke_api_callbacks); | 539 IterateRoots(isolate, &mark, !invoke_api_callbacks); |
540 mark.DrainMarkingStack(); | 540 mark.DrainMarkingStack(); |
541 IterateWeakReferences(isolate, &mark); | 541 IterateWeakReferences(isolate, &mark); |
542 MarkingWeakVisitor mark_weak; | 542 MarkingWeakVisitor mark_weak; |
543 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); | 543 IterateWeakRoots(isolate, &mark_weak, invoke_api_callbacks); |
544 // TODO(koda): Add hand-over callback and centralize skipped code functions. | 544 // TODO(koda): Add hand-over callback and centralize skipped code functions. |
545 marked_bytes_ = mark.marked_bytes(); | 545 marked_bytes_ = mark.marked_bytes(); |
546 mark.Finalize(); | 546 mark.Finalize(); |
547 delay_set.ClearReferences(); | 547 delay_set.ClearReferences(); |
548 ProcessWeakTables(page_space); | 548 ProcessWeakTables(page_space); |
549 ProcessObjectIdTable(isolate); | 549 ProcessObjectIdTable(isolate); |
550 } | 550 } |
551 Epilogue(isolate, invoke_api_callbacks); | 551 Epilogue(isolate, invoke_api_callbacks); |
552 } | 552 } |
553 | 553 |
554 } // namespace dart | 554 } // namespace dart |
OLD | NEW |