Flutter Engine
The Flutter Engine
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 540 of file profiler.h.

Constructor & Destructor Documentation

◆ CodeLookupTable()

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

Definition at line 1478 of file profiler.cc.

1478 {
1479 Build(thread);
1480}

Member Function Documentation

◆ At()

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

Definition at line 546 of file profiler.h.

546 {
547 return code_objects_.At(index);
548 }

◆ FindCode()

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

Definition at line 1550 of file profiler.cc.

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

◆ length()

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

Definition at line 544 of file profiler.h.

544{ return code_objects_.length(); }

Friends And Related Function Documentation

◆ CodeLookupTableBuilder

friend class CodeLookupTableBuilder
friend

Definition at line 560 of file profiler.h.


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