Search in sources :

Example 1 with MethodMapping

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

the class LiteralBlockSendCallSite method findMethod.

@Override
protected MethodHandle findMethod(Class receiverClass) {
    MethodMapping methodMapping = ImageBootstrapper.systemMapping.methodMappingFor_methodName_(receiverClass, selector);
    if (methodMapping == null) {
        return createDNUHandle(receiverClass).asType(type);
    }
    MethodNode methodNode = methodMapping.methodNode();
    return inlineBlocks(methodNode, ImageBootstrapper.systemMapping.classMappingForJavaClass_(receiverClass).reference(), (JVMNonPrimitiveType) ImageBootstrapper.systemMapping.compilerTools().jvmTypeForClass_(receiverClass));
}
Also used : MethodMapping(st.gravel.support.compiler.ast.MethodMapping) MethodNode(st.gravel.support.compiler.ast.MethodNode)

Example 2 with MethodMapping

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

the class LiteralBlockSendCallSite method findMethodForNil.

@Override
protected MethodHandle findMethodForNil() {
    MethodMapping methodMapping = ImageBootstrapper.systemMapping.methodMappingForNil_(selector);
    if (methodMapping == null) {
        return createDNUHandleForNil();
    }
    MethodNode methodNode = methodMapping.methodNode();
    return inlineBlocks(methodNode, ImageBootstrapper.systemMapping.nilClassMapping().reference(), JVMDefinedObjectType.factory.object());
}
Also used : MethodMapping(st.gravel.support.compiler.ast.MethodMapping) MethodNode(st.gravel.support.compiler.ast.MethodNode)

Aggregations

MethodMapping (st.gravel.support.compiler.ast.MethodMapping)2 MethodNode (st.gravel.support.compiler.ast.MethodNode)2