Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::ConcurrentMarkTask Class Reference
Inheritance diagram for dart::ConcurrentMarkTask:
dart::ThreadPool::Task dart::IntrusiveDListEntry< Task >

Public Member Functions

 ConcurrentMarkTask (GCMarker *marker, IsolateGroup *isolate_group, PageSpace *page_space, SyncMarkingVisitor *visitor)
 
virtual void Run ()
 
- Public Member Functions inherited from dart::ThreadPool::Task
virtual ~Task ()
 
virtual void Run ()=0
 
- Public Member Functions inherited from dart::IntrusiveDListEntry< Task >
 IntrusiveDListEntry ()
 
 ~IntrusiveDListEntry ()
 

Additional Inherited Members

- Protected Member Functions inherited from dart::ThreadPool::Task
 Task ()
 

Detailed Description

Definition at line 1007 of file marker.cc.

Constructor & Destructor Documentation

◆ ConcurrentMarkTask()

dart::ConcurrentMarkTask::ConcurrentMarkTask ( GCMarker marker,
IsolateGroup isolate_group,
PageSpace page_space,
SyncMarkingVisitor visitor 
)
inline

Definition at line 1009 of file marker.cc.

1013 : marker_(marker),
1014 isolate_group_(isolate_group),
1015 page_space_(page_space),
1016 visitor_(visitor) {
1017#if defined(DEBUG)
1018 MonitorLocker ml(page_space_->tasks_lock());
1019 ASSERT(page_space_->phase() == PageSpace::kMarking);
1020#endif
1021 }
static const char marker[]
Monitor * tasks_lock() const
Definition: pages.h:314
Phase phase() const
Definition: pages.h:341
#define ASSERT(E)

Member Function Documentation

◆ Run()

virtual void dart::ConcurrentMarkTask::Run ( )
inlinevirtual

Implements dart::ThreadPool::Task.

Definition at line 1023 of file marker.cc.

1023 {
1025 isolate_group_, Thread::kMarkerTask, /*bypass_safepoint=*/true);
1026 ASSERT(result);
1027 {
1030
1031 marker_->IterateRoots(visitor_);
1032 visitor_->FinishedRoots();
1033
1035 int64_t stop = OS::GetCurrentMonotonicMicros();
1036 visitor_->AddMicros(stop - start);
1037 if (FLAG_log_marker_tasks) {
1038 THR_Print("Task marked %" Pd " bytes in %" Pd64 " micros.\n",
1039 visitor_->marked_bytes(), visitor_->marked_micros());
1040 }
1041 }
1042
1043 // Exit isolate cleanly *before* notifying it, to avoid shutdown race.
1044 Thread::ExitIsolateGroupAsHelper(/*bypass_safepoint=*/true);
1045 // This marker task is done. Notify the original isolate.
1046 {
1047 MonitorLocker ml(page_space_->tasks_lock());
1048 page_space_->set_tasks(page_space_->tasks() - 1);
1049 page_space_->set_concurrent_marker_tasks(
1050 page_space_->concurrent_marker_tasks() - 1);
1052 page_space_->concurrent_marker_tasks_active() - 1);
1053 ASSERT(page_space_->phase() == PageSpace::kMarking);
1054 if (page_space_->concurrent_marker_tasks() == 0) {
1057 }
1058 ml.NotifyAll();
1059 }
1060 }
void ScheduleInterrupts(uword interrupt_bits)
Definition: isolate.cc:1960
void AddMicros(int64_t micros)
Definition: marker.cc:50
uintptr_t marked_bytes() const
Definition: marker.cc:48
void DrainMarkingStackWithPauseChecks()
Definition: marker.cc:117
int64_t marked_micros() const
Definition: marker.cc:49
static int64_t GetCurrentMonotonicMicros()
void set_concurrent_marker_tasks_active(intptr_t val)
Definition: pages.h:333
intptr_t concurrent_marker_tasks_active() const
Definition: pages.h:329
intptr_t tasks() const
Definition: pages.h:315
void set_tasks(intptr_t val)
Definition: pages.h:316
void set_concurrent_marker_tasks(intptr_t val)
Definition: pages.h:324
@ kAwaitingFinalization
Definition: pages.h:133
intptr_t concurrent_marker_tasks() const
Definition: pages.h:320
void set_phase(Phase val)
Definition: pages.h:342
@ kVMInterrupt
Definition: thread.h:488
@ kMarkerTask
Definition: thread.h:349
static Thread * Current()
Definition: thread.h:362
static void ExitIsolateGroupAsHelper(bool bypass_safepoint)
Definition: thread.cc:499
static bool EnterIsolateGroupAsHelper(IsolateGroup *isolate_group, TaskKind kind, bool bypass_safepoint)
Definition: thread.cc:481
#define THR_Print(format,...)
Definition: log.h:20
GAsyncResult * result
#define Pd64
Definition: globals.h:416
#define Pd
Definition: globals.h:408
#define TIMELINE_FUNCTION_GC_DURATION(thread, name)
Definition: timeline.h:41

The documentation for this class was generated from the following file: