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

Method widen

chapter15/src/main/java/com/seaofnodes/simple/node/Node.java:544–552  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers 5

parseShiftMethod · 0.95
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