Search in sources :

Example 1 with ClassPartMapping

use of st.gravel.support.compiler.ast.ClassPartMapping in project gravel by gravel-st.

the class SystemMappingUpdater method linkMethods_in_identityClass_to_isStatic_.

public ClassPartMapping linkMethods_in_identityClass_to_isStatic_(final MethodNode[] _methods, final Class _javaClass, final Class _identityClass, final ClassPartMapping _cpm, final boolean _isStatic) {
    final ClassPartMapping[] _ecm;
    _ecm = new ClassPartMapping[1];
    _ecm[0] = _cpm;
    for (final MethodNode _m : _methods) {
        final String _fn;
        final java.lang.invoke.MethodHandle _methodHandle;
        final st.gravel.core.Symbol _selector;
        _selector = st.gravel.core.Symbol.value(_m.selector());
        _fn = _selectorConverter.selectorAsFunctionName_(_selector);
        _methodHandle = _compilerTools.methodHandleAt_numArgs_in_identityClass_isStatic_(_fn, _selector.numArgs(), _javaClass, _identityClass, _isStatic);
        _ecm[0] = _ecm[0].withMethodMapping_(((MethodMapping) MethodMapping.factory.methodNode_methodHandle_definingClass_(_m, _methodHandle, _javaClass)));
    }
    return _ecm[0];
}
Also used : ExtensionClassPartMapping(st.gravel.support.compiler.ast.ExtensionClassPartMapping) ClassPartMapping(st.gravel.support.compiler.ast.ClassPartMapping) IdentityClassPartMapping(st.gravel.support.compiler.ast.IdentityClassPartMapping) List(java.util.List) ArrayList(java.util.ArrayList) UnaryMethodNode(st.gravel.support.compiler.ast.UnaryMethodNode) MethodNode(st.gravel.support.compiler.ast.MethodNode)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 ClassPartMapping (st.gravel.support.compiler.ast.ClassPartMapping)1 ExtensionClassPartMapping (st.gravel.support.compiler.ast.ExtensionClassPartMapping)1 IdentityClassPartMapping (st.gravel.support.compiler.ast.IdentityClassPartMapping)1 MethodNode (st.gravel.support.compiler.ast.MethodNode)1 UnaryMethodNode (st.gravel.support.compiler.ast.UnaryMethodNode)1