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

Method widen

chapter12/src/main/java/com/seaofnodes/simple/node/Node.java:550–558  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

548 // If any input is a float, flip to a float-flavored opcode and widen any
549 // non-float input.
550 public final Node widen() {
551 if( !hasFloatInput() ) return this;
552 Node flt = copyF();
553 if( flt==null ) return this;
554 for( int i=1; i<nIns(); i++ )
555 flt.setDef(i, in(i)._type instanceof TypeFloat ? in(i) : new ToFloatNode(in(i)).peephole());
556 kill();
557 return flt;
558 }
559 private boolean hasFloatInput() {
560 for( int i=1; i<nIns(); i++ )
561 if( in(i)._type instanceof TypeFloat )

Callers 4

parseAdditionMethod · 0.95
parseComparisonMethod · 0.45
parseMultiplicationMethod · 0.45
parseUnaryMethod · 0.45

Calls 7

hasFloatInputMethod · 0.95
copyFMethod · 0.95
nInsMethod · 0.95
setDefMethod · 0.95
inMethod · 0.95
killMethod · 0.95
peepholeMethod · 0.45

Tested by

no test coverage detected