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

Method con

chapter19/src/test/java/com/seaofnodes/simple/Eval2.java:300–309  ·  view source on GitHub ↗
( Type t )

Source from the content-addressed store, hash-verified

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