SOMns icon indicating copy to clipboard operation
SOMns copied to clipboard

Possible regression with #perform:* because of PR #30

Open smarr opened this issue 9 years ago • 0 comments

The MessageSendNode used to use a different node implementation for while:

    @Override
    protected PreevaluatedExpression specializeBinary(final Object[] arguments) {
      switch (selector.getString()) {
        case "whileTrue:": {
          if (arguments[1] instanceof SBlock && arguments[0] instanceof SBlock) {
            SBlock argBlock = (SBlock) arguments[1];
            return replace(new WhileWithDynamicBlocksNode((SBlock) arguments[0],
                argBlock, true, getSourceSection()));
          }
          break;
        }
        case "whileFalse:":
          if (arguments[1] instanceof SBlock && arguments[0] instanceof SBlock) {
            SBlock    argBlock     = (SBlock)    arguments[1];
            return replace(new WhileWithDynamicBlocksNode(
                (SBlock) arguments[0], argBlock, false, getSourceSection()));
          }
          break; // use normal send
      }

      return super.specializeBinary(arguments);
    }

In #30, we removed that specialization. Think, we need to change the while implementation. Should simplify implementation, don't think, the differences should have an impact on performance.

smarr avatar Sep 11 '16 14:09 smarr