use of st.gravel.support.compiler.ast.SuperNode in project gravel by gravel-st.
the class JVMMethodCompiler method produceSuperSend_.
public JVMMethodCompiler produceSuperSend_(final MessageNode _messageNode) {
final st.gravel.core.Symbol _selector;
final SuperNode _superNode;
final String _functionName;
String _superFN;
_superNode = ((SuperNode) _messageNode.receiver());
this.produceVarRead_("self");
for (final Node _arg : _messageNode.arguments()) {
JVMMethodCompiler.this.visit_(_arg);
}
_selector = st.gravel.core.Symbol.value(_messageNode.selector());
_functionName = _parent.selectorConverter().selectorAsFunctionName_(_selector);
if (_isBlock) {
final JVMMethodType _superSig;
JVMMethodCompiler.this.ensureCast_(_parent.selfType());
_superFN = "access$" + _functionName;
_superSig = JVMMethodType.factory.dynamic_(_messageNode.numArgs()).copyWithFirst_(_parent.selfType());
JVMMethodCompiler.this.emit_(InvokeStatic.factory.ownerType_name_signature_(_parent.ownerType(), _superFN, _superSig));
_parent.addInvokeSuper_functionName_numArgs_superReference_superSig_(_superFN, _functionName, _selector.numArgs(), _superNode.reference().toString(), _superSig);
} else {
JVMMethodCompiler.this.emit_(DynamicSuperSend.factory.functionName_numArgs_superReference_(_functionName, _selector.numArgs(), _superNode.reference().toString()));
}
return this;
}
Aggregations