use of st.gravel.support.compiler.jvm.BlockSendArgument in project gravel by gravel-st.
the class BlockInliner method buildNonOptimized.
public java.lang.invoke.MethodHandle buildNonOptimized() {
final MethodNode _node;
final VariableDeclarationNode[] _arguments;
final List<Expression>[] _sendArgs;
_sendArgs = new List[1];
for (final String _each : _copiedArgumentNames) {
final String _newTempName;
_newTempName = BlockInliner.this.newTempName_for_(_each, _methodNode);
_copiedArgRenames.put(_each, _newTempName);
}
_arguments = this.buildMethodNodeArguments_(_methodNode);
_sendArgs[0] = new java.util.ArrayList();
st.gravel.support.jvm.ArrayExtensions.with_do_(_astConstants, _methodNode.arguments(), new st.gravel.support.jvm.Block2<Object, BlockSendArgument, VariableDeclarationNode>() {
@Override
public Object value_value_(final BlockSendArgument _astConstant, final VariableDeclarationNode _arg) {
if (_astConstant == null) {
return _sendArgs[0].add(_arg.asVariableNode());
} else {
return _sendArgs[0].add(BlockInliner.this.renamedBlockNodeFor_(_astConstant));
}
}
});
_node = this.newMethodNode_arguments_body_(_systemMapping.selectorConverter().selectorForNumArgs_(_arguments.length), _arguments, SequenceNode.factory.return_(SelfNode.factory.basicNew().send_withAll_(_methodNode.selector(), _sendArgs[0].toArray(new Expression[_sendArgs[0].size()]))));
this.log_text_("nonOptimized: ", _node.sourceString());
return this.compileMethodNode_allowBlockInlining_(this.link_(_node), false);
}
Aggregations