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

Method load

chapter22/src/test/java/com/seaofnodes/simple/Eval2.java:349–367  ·  view source on GitHub ↗
( LoadNode ld )

Source from the content-addressed store, hash-verified

347 }
348
349 private static Object load( LoadNode ld ) {
350 Object f = val(ld.ptr());
351 // Check for dense constant array
352 if( f instanceof TypeMemPtr tmp ) {
353 assert tmp._obj._con != TypeConAry.BOT;
354 if( ld._name.equals("#") )
355 return (long)tmp._obj._con.len();
356 int idx = offToIdx(x(ld.off()),tmp._obj);
357 return tmp._obj._con.at(idx);
358 }
359 Object[] fs = (Object[])f;
360 if( ld._name.equals("#") )
361 return (long)fs.length;
362 TypeMemPtr tmp = (TypeMemPtr)ld.ptr()._type;
363 int idx = tmp._obj.isAry()
364 ? offToIdx(x(ld.off()),tmp._obj)
365 : tmp._obj.find(ld._name);
366 return fs[idx];
367 }
368
369 private static Object store( StoreNode st ) {
370 if( st._name.equals("#") )

Callers 1

computeMethod · 0.95

Calls 10

valMethod · 0.95
offToIdxMethod · 0.95
xMethod · 0.95
ptrMethod · 0.45
equalsMethod · 0.45
lenMethod · 0.45
offMethod · 0.45
atMethod · 0.45
isAryMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected