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

Method load

chapter24/src/test/java/com/seaofnodes/simple/Eval2.java:370–389  ·  view source on GitHub ↗
( LoadNode ld )

Source from the content-addressed store, hash-verified

368 }
369
370 private static Object load( LoadNode ld ) {
371 Object f = val(ld.ptr());
372 // Check for dense constant array
373 if( f instanceof TypeMemPtr tmp ) {
374 //assert tmp._obj._con != TypeConAry.BOT;
375 //if( ld._name.equals("#") )
376 // return (long)tmp._obj._con.len();
377 //int idx = offToIdx(x(ld.off()),tmp._obj);
378 //return tmp._obj._con.at(idx);
379 throw Utils.TODO();
380 }
381 Object[] fs = (Object[])f;
382 if( ld._name.equals("#") )
383 return (long)fs.length;
384 TypeMemPtr tmp = (TypeMemPtr)ld.ptr()._type;
385 int idx = tmp._obj.isAry()
386 ? offToIdx(x(ld.off()),tmp._obj)
387 : tmp._obj.find(ld._name);
388 return fs[idx];
389 }
390
391 private static Object store( StoreNode st ) {
392 if( st._name.equals("#") )

Callers 1

computeMethod · 0.95

Calls 9

valMethod · 0.95
TODOMethod · 0.95
offToIdxMethod · 0.95
xMethod · 0.95
ptrMethod · 0.45
equalsMethod · 0.45
isAryMethod · 0.45
offMethod · 0.45
findMethod · 0.45

Tested by

no test coverage detected