Add a new def to an existing Node. Keep the edges correct by adding the corresponding def->use edge. @param new_def the new definition, appended to the end of existing definitions @return new_def for flow coding
(Node new_def)
| 168 | * Try to peephole at this node and return a better replacement Node if |
| 169 | * possible. We compute a {@link Type} and then check and replace: |
| 170 | * <ul> |
| 171 | * <li>if the Type {@link Type#isConstant}, we replace with a {@link ConstantNode}</li> |
| 172 | * <li>in a future chapter we will look for a |
| 173 | * <a href="https://en.wikipedia.org/wiki/Common_subexpression_elimination">Common Subexpression</a> |
| 174 | * to eliminate.</li> |
| 175 | * <li>we ask the Node for a better replacement (again, none enabled in this chapter)</li> |
| 176 | * </ul> |
| 177 | */ |
| 178 | public final Node peephole() { |
| 179 | var obs = Parser.PARSER == null ? null : Parser.PARSER._obs; |
| 180 | if( obs != null ) obs.before(this); |