Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
dart::CompilerTimings::Scope Class Reference

#include <compiler_timings.h>

Inheritance diagram for dart::CompilerTimings::Scope:
dart::StackResource

Public Member Functions

 Scope (Thread *thread, TimerId id)
 
 ~Scope ()
 
- Public Member Functions inherited from dart::StackResource
 StackResource (ThreadState *thread)
 
virtual ~StackResource ()
 
ThreadStatethread () const
 

Additional Inherited Members

- Static Public Member Functions inherited from dart::StackResource
static void Unwind (ThreadState *thread)
 
static void UnwindAbove (ThreadState *thread, StackResource *new_top)
 

Detailed Description

Definition at line 87 of file compiler_timings.h.

Constructor & Destructor Documentation

◆ Scope()

dart::CompilerTimings::Scope::Scope ( Thread thread,
TimerId  id 
)
inline

Definition at line 89 of file compiler_timings.h.

90 : StackResource(thread), stats_(thread->compiler_timings()) {
91 if (stats_ != nullptr) {
92 outer_nested_ = stats_->nested_;
93 if (*outer_nested_ == nullptr) {
94 // Created array of nested timers if we don't have one yet.
95 *outer_nested_ = std::make_unique<Timers>();
96 }
97
98 timer_ = &(*outer_nested_)->timers_[id];
99 stats_->nested_ = &(*outer_nested_)->nested_[id];
100
101 timer_->Start();
102 }
103 }
ThreadState * thread() const
Definition allocation.h:33
StackResource(ThreadState *thread)
Definition allocation.h:25
void Start()
Definition timer.h:111
const uintptr_t id

◆ ~Scope()

dart::CompilerTimings::Scope::~Scope ( )
inline

Definition at line 105 of file compiler_timings.h.

105 {
106 if (stats_ != nullptr) {
107 timer_->Stop();
108 stats_->nested_ = outer_nested_;
109 }
110 }
void Stop()
Definition timer.h:117

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