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

#include <profiler.h>

Inheritance diagram for dart::CodeLookupTable:
dart::ZoneAllocated

Public Member Functions

 CodeLookupTable (Thread *thread)
 
intptr_t length () const
 
const CodeDescriptorAt (intptr_t index) const
 
const CodeDescriptorFindCode (uword pc) const
 
- 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)
 

Friends

class CodeLookupTableBuilder
 

Detailed Description

Definition at line 547 of file profiler.h.

Constructor & Destructor Documentation

◆ CodeLookupTable()

dart::CodeLookupTable::CodeLookupTable ( Thread thread)
explicit

Definition at line 1472 of file profiler.cc.

1472 {
1473 Build(thread);
1474}

Member Function Documentation

◆ At()

const CodeDescriptor * dart::CodeLookupTable::At ( intptr_t  index) const
inline

Definition at line 553 of file profiler.h.

553 {
554 return code_objects_.At(index);
555 }

◆ FindCode()

const CodeDescriptor * dart::CodeLookupTable::FindCode ( uword  pc) const

Definition at line 1544 of file profiler.cc.

1544 {
1545 intptr_t first = 0;
1546 intptr_t count = length();
1547 while (count > 0) {
1548 intptr_t current = first;
1549 intptr_t step = count / 2;
1550 current += step;
1551 const CodeDescriptor* cd = At(current);
1552 if (pc >= cd->Start()) {
1553 first = ++current;
1554 count -= step + 1;
1555 } else {
1556 count = step;
1557 }
1558 }
1559 // First points to the first code object whose entry is greater than PC.
1560 // That means the code object we need to check is first - 1.
1561 if (first == 0) {
1562 return nullptr;
1563 }
1564 first--;
1565 ASSERT(first >= 0);
1566 ASSERT(first < length());
1567 const CodeDescriptor* cd = At(first);
1568 if (cd->Contains(pc)) {
1569 return cd;
1570 }
1571 return nullptr;
1572}
static int step(int x, SkScalar min, SkScalar max)
Definition BlurTest.cpp:215
int count
intptr_t length() const
Definition profiler.h:551
const CodeDescriptor * At(intptr_t index) const
Definition profiler.h:553
#define ASSERT(E)

◆ length()

intptr_t dart::CodeLookupTable::length ( ) const
inline

Definition at line 551 of file profiler.h.

551{ return code_objects_.length(); }

Friends And Related Symbol Documentation

◆ CodeLookupTableBuilder

friend class CodeLookupTableBuilder
friend

Definition at line 567 of file profiler.h.


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