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

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

Issue 1814813003: Collect samples for background threads. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/gc_sweeper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "vm/allocation.h" 11 #include "vm/allocation.h"
12 #include "vm/dart_api_state.h" 12 #include "vm/dart_api_state.h"
13 #include "vm/isolate.h" 13 #include "vm/isolate.h"
14 #include "vm/log.h" 14 #include "vm/log.h"
15 #include "vm/pages.h" 15 #include "vm/pages.h"
16 #include "vm/raw_object.h" 16 #include "vm/raw_object.h"
17 #include "vm/stack_frame.h" 17 #include "vm/stack_frame.h"
18 #include "vm/store_buffer.h" 18 #include "vm/store_buffer.h"
19 #include "vm/thread_barrier.h" 19 #include "vm/thread_barrier.h"
20 #include "vm/thread_pool.h" 20 #include "vm/thread_pool.h"
21 #include "vm/thread_registry.h" 21 #include "vm/thread_registry.h"
22 #include "vm/timeline.h"
22 #include "vm/visitor.h" 23 #include "vm/visitor.h"
23 #include "vm/object_id_ring.h" 24 #include "vm/object_id_ring.h"
24 25
25 namespace dart { 26 namespace dart {
26 27
27 DEFINE_FLAG(int, marker_tasks, 2, 28 DEFINE_FLAG(int, marker_tasks, 2,
28 "The number of tasks to spawn during old gen GC marking (0 means " 29 "The number of tasks to spawn during old gen GC marking (0 means "
29 "perform all marking on main thread)."); 30 "perform all marking on main thread).");
30 DEFINE_FLAG(bool, log_marker_tasks, false, 31 DEFINE_FLAG(bool, log_marker_tasks, false,
31 "Log debugging information for old gen GC marking tasks."); 32 "Log debugging information for old gen GC marking tasks.");
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
595 collect_code_(collect_code), 596 collect_code_(collect_code),
596 task_index_(task_index), 597 task_index_(task_index),
597 num_tasks_(num_tasks), 598 num_tasks_(num_tasks),
598 num_busy_(num_busy) { 599 num_busy_(num_busy) {
599 } 600 }
600 601
601 virtual void Run() { 602 virtual void Run() {
602 bool result = Thread::EnterIsolateAsHelper(isolate_, true); 603 bool result = Thread::EnterIsolateAsHelper(isolate_, true);
603 ASSERT(result); 604 ASSERT(result);
604 { 605 {
605 StackZone stack_zone(Thread::Current()); 606 Thread* thread = Thread::Current();
607 TimelineDurationScope tds(thread, Timeline::GetGCStream(), "MarkTask");
608 StackZone stack_zone(thread);
606 Zone* zone = stack_zone.GetZone(); 609 Zone* zone = stack_zone.GetZone();
607 SkippedCodeFunctions* skipped_code_functions = 610 SkippedCodeFunctions* skipped_code_functions =
608 collect_code_ ? new(zone) SkippedCodeFunctions() : NULL; 611 collect_code_ ? new(zone) SkippedCodeFunctions() : NULL;
609 SyncMarkingVisitor visitor(isolate_, heap_, page_space_, marking_stack_, 612 SyncMarkingVisitor visitor(isolate_, heap_, page_space_, marking_stack_,
610 delay_set_, skipped_code_functions); 613 delay_set_, skipped_code_functions);
611 // Phase 1: Iterate over roots and drain marking stack in tasks. 614 // Phase 1: Iterate over roots and drain marking stack in tasks.
612 marker_->IterateRoots(isolate_, &visitor, task_index_, num_tasks_); 615 marker_->IterateRoots(isolate_, &visitor, task_index_, num_tasks_);
613 do { 616 do {
614 visitor.DrainMarkingStack(); 617 visitor.DrainMarkingStack();
615 618
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 barrier.Exit(); 750 barrier.Exit();
748 } 751 }
749 delay_set.ClearReferences(); 752 delay_set.ClearReferences();
750 ProcessWeakTables(page_space); 753 ProcessWeakTables(page_space);
751 ProcessObjectIdTable(isolate); 754 ProcessObjectIdTable(isolate);
752 } 755 }
753 Epilogue(isolate, invoke_api_callbacks); 756 Epilogue(isolate, invoke_api_callbacks);
754 } 757 }
755 758
756 } // namespace dart 759 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/compiler.cc ('k') | runtime/vm/gc_sweeper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698