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

Method con

chapter22/src/test/java/com/seaofnodes/simple/Eval2.java:301–310  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

299
300 // Java box ints and floats. Other things can just be null or some informative string
301 private static Object con( Type t ) {
302 return switch ( t ) {
303 case TypeInteger i -> i.isConstant() ? (Long )i.value() : "INT";
304 case TypeFloat f -> f.isConstant() ? (Double)f.value() : "FLT";
305 case TypeMemPtr tmp -> tmp;
306 case TypeFunPtr tfp -> tfp;
307 case TypeMem mem -> "MEM";
308 default -> null;
309 };
310 }
311
312 // Convert array size to array element count
313 private static int offToIdx( long off, TypeStruct t) {

Callers 2

computeMethod · 0.95
allocMethod · 0.95

Calls 2

isConstantMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected