MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / findFrameDesc

Method findFrameDesc

src/codeCache.cpp:294–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294FrameDesc* CodeCache::findFrameDesc(const void* pc) {
295 u32 target_loc = (const char*)pc - _text_base;
296 int low = 0;
297 int high = _dwarf_table_length - 1;
298
299 while (low <= high) {
300 int mid = (unsigned int)(low + high) >> 1;
301 if (_dwarf_table[mid].loc < target_loc) {
302 low = mid + 1;
303 } else if (_dwarf_table[mid].loc > target_loc) {
304 high = mid - 1;
305 } else {
306 return &_dwarf_table[mid];
307 }
308 }
309
310 if (low > 0) {
311 return &_dwarf_table[low - 1];
312 } else if (target_loc - _plt_offset < _plt_size) {
313 return &FrameDesc::empty_frame;
314 } else {
315 return &FrameDesc::default_frame;
316 }
317}
318
319size_t CodeCache::usedMemory() {
320 size_t bytes = _capacity * sizeof(CodeBlob);

Callers 2

walkDwarfMethod · 0.80
walkVMMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected