MCPcopy Create free account
hub / github.com/ReadyTalk/avian / findFrameMapInSimpleTable

Function findFrameMapInSimpleTable

src/compile.cpp:7377–7406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7375}
7376
7377void findFrameMapInSimpleTable(MyThread* t,
7378 GcMethod* method,
7379 GcIntArray* table,
7380 int32_t offset,
7381 int32_t** map,
7382 unsigned* start)
7383{
7384 unsigned tableSize = simpleFrameMapTableSize(t, method, table);
7385 unsigned indexSize = table->length() - tableSize;
7386
7387 *map = &table->body()[indexSize];
7388
7389 unsigned bottom = 0;
7390 unsigned top = indexSize;
7391 for (unsigned span = top - bottom; span; span = top - bottom) {
7392 unsigned middle = bottom + (span / 2);
7393 int32_t v = table->body()[middle];
7394
7395 if (offset == v) {
7396 *start = frameMapSizeInBits(t, method) * middle;
7397 return;
7398 } else if (offset < v) {
7399 top = middle;
7400 } else {
7401 bottom = middle + 1;
7402 }
7403 }
7404
7405 abort(t);
7406}
7407
7408void findFrameMap(MyThread* t,
7409 void* stack UNUSED,

Callers 1

findFrameMapFunction · 0.85

Calls 5

simpleFrameMapTableSizeFunction · 0.85
frameMapSizeInBitsFunction · 0.85
bodyMethod · 0.80
lengthMethod · 0.65
abortFunction · 0.50

Tested by

no test coverage detected