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

Method widen

chapter24/src/main/java/com/seaofnodes/simple/node/Node.java:636–644  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

634 // If any input is a float, flip to a float-flavored opcode and widen any
635 // non-float input.
636 public final Node widen() {
637 if( !hasFloatInput() ) return this;
638 Node flt = copyF();
639 if( flt==null ) return this;
640 for( int i=1; i<nIns(); i++ )
641 flt.setDef(i, in(i)._type instanceof TypeFloat ? in(i) : new ToFloatNode(in(i)).peephole());
642 kill();
643 return flt;
644 }
645 private boolean hasFloatInput() {
646 for( int i=1; i<nIns(); i++ )
647 if( in(i)._type instanceof TypeFloat )

Callers 3

parseShiftMethod · 0.95
parseAdditionMethod · 0.95
opAssignMethod · 0.95

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