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

Method store

chapter24/src/test/java/com/seaofnodes/simple/Eval2.java:391–402  ·  view source on GitHub ↗
( StoreNode st )

Source from the content-addressed store, hash-verified

389 }
390 Object[] fs = (Object[])f;
391 if( ld._name.equals("#") )
392 return (long)fs.length;
393 TypeMemPtr tmp = (TypeMemPtr)ld.ptr()._type;
394 int idx = tmp._obj.isAry()
395 ? offToIdx(x(ld.off()),tmp._obj)
396 : tmp._obj.find(ld._name);
397 return fs[idx];
398 }
399
400 private static Object store( StoreNode st ) {
401 if( st._name.equals("#") )
402 return "$mem"; // Eval stores the length in the java object[], no need to set it now
403 TypeMemPtr tmp = (TypeMemPtr)st.ptr()._type;
404 Object[] fs = (Object[])val(st.ptr());
405 int idx = tmp._obj.isAry()

Callers 1

computeMethod · 0.95

Calls 8

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

Tested by

no test coverage detected