Flutter Engine
The Flutter Engine
Classes | Public Member Functions | List of all members
dart::ProfileCodeInlinedFunctionsCache Class Reference

#include <profiler_service.h>

Inheritance diagram for dart::ProfileCodeInlinedFunctionsCache:
dart::ZoneAllocated

Public Member Functions

 ProfileCodeInlinedFunctionsCache ()
 
 ~ProfileCodeInlinedFunctionsCache ()
 
void Get (uword pc, const Code &code, ProcessedSample *sample, intptr_t frame_index, GrowableArray< const Function * > **inlined_functions, GrowableArray< TokenPosition > **inlined_token_positions, TokenPosition *token_position)
 
- Public Member Functions inherited from dart::ZoneAllocated
 ZoneAllocated ()
 
void * operator new (size_t size)
 
void * operator new (size_t size, Zone *zone)
 
void operator delete (void *pointer)
 

Detailed Description

Definition at line 60 of file profiler_service.h.

Constructor & Destructor Documentation

◆ ProfileCodeInlinedFunctionsCache()

dart::ProfileCodeInlinedFunctionsCache::ProfileCodeInlinedFunctionsCache ( )
inline

Definition at line 62 of file profiler_service.h.

62 : cache_cursor_(0), last_hit_(0) {
63 for (intptr_t i = 0; i < kCacheSize; i++) {
64 cache_[i].Reset();
65 }
66 cache_hit_ = 0;
67 cache_miss_ = 0;
68 }

◆ ~ProfileCodeInlinedFunctionsCache()

dart::ProfileCodeInlinedFunctionsCache::~ProfileCodeInlinedFunctionsCache ( )
inline

Definition at line 70 of file profiler_service.h.

70 {
71 if (FLAG_trace_profiler) {
72 intptr_t total = cache_hit_ + cache_miss_;
73 OS::PrintErr("LOOKUPS: %" Pd " HITS: %" Pd " MISSES: %" Pd "\n", total,
74 cache_hit_, cache_miss_);
75 }
76 }
static void static void PrintErr(const char *format,...) PRINTF_ATTRIBUTE(1
#define Pd
Definition: globals.h:408

Member Function Documentation

◆ Get()

void dart::ProfileCodeInlinedFunctionsCache::Get ( uword  pc,
const Code code,
ProcessedSample sample,
intptr_t  frame_index,
GrowableArray< const Function * > **  inlined_functions,
GrowableArray< TokenPosition > **  inlined_token_positions,
TokenPosition token_position 
)

Definition at line 835 of file profiler_service.cc.

843 {
844 const intptr_t offset = OffsetForPC(pc, code, sample, frame_index);
845 if (FindInCache(pc, offset, inlined_functions, inlined_token_positions,
846 token_position)) {
847 // Found in cache.
848 return;
849 }
850 Add(pc, code, sample, frame_index, inlined_functions, inlined_token_positions,
851 token_position);
852}
SeparatedVector2 offset

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