SOMns
SOMns copied to clipboard
Possible regression with #perform:* because of PR #30
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.