MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / offToIdx

Method offToIdx

chapter18/src/test/java/com/seaofnodes/simple/Eval2.java:312–318  ·  view source on GitHub ↗
( long off, TypeStruct t)

Source from the content-addressed store, hash-verified

310
311 // Convert array size to array element count
312 private static int offToIdx( long off, TypeStruct t) {
313 off -= t.aryBase();
314 int scale = t.aryScale();
315 long mask = (1L << scale)-1;
316 assert (off & mask) == 0;
317 return (int)(off>>scale);
318 }
319
320 // Builds and returns a pointer Object
321 private static Object alloc(NewNode alloc) {

Callers 3

allocMethod · 0.95
loadMethod · 0.95
storeMethod · 0.95

Calls 2

aryBaseMethod · 0.45
aryScaleMethod · 0.45

Tested by

no test coverage detected