Java Code Examples for org.codehaus.groovy.reflection.CachedClass#getCallSiteLoader()

The following examples show how to use org.codehaus.groovy.reflection.CachedClass#getCallSiteLoader() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CallSiteGenerator.java    From groovy with Apache License 2.0 5 votes vote down vote up
public static Constructor compilePogoMethod(CachedMethod cachedMethod) {
    ClassWriter cw = makeClassWriter();

    final CachedClass declClass = cachedMethod.getDeclaringClass();
    final CallSiteClassLoader callSiteLoader = declClass.getCallSiteLoader();
    final String name = callSiteLoader.createClassName(cachedMethod.getName());

    final byte[] bytes = genPogoMetaMethodSite(cachedMethod, cw, name);

    return callSiteLoader.defineClassAndGetConstructor(name, bytes);
}
 
Example 2
Source File: CallSiteGenerator.java    From groovy with Apache License 2.0 5 votes vote down vote up
public static Constructor compilePojoMethod(CachedMethod cachedMethod) {
    ClassWriter cw = makeClassWriter();

    final CachedClass declClass = cachedMethod.getDeclaringClass();
    final CallSiteClassLoader callSiteLoader = declClass.getCallSiteLoader();
    final String name = callSiteLoader.createClassName(cachedMethod.getName());

    final byte[] bytes = genPojoMetaMethodSite(cachedMethod, cw, name);

    return callSiteLoader.defineClassAndGetConstructor(name, bytes);
}
 
Example 3
Source File: CallSiteGenerator.java    From groovy with Apache License 2.0 5 votes vote down vote up
public static Constructor compileStaticMethod(CachedMethod cachedMethod) {
    ClassWriter cw = makeClassWriter();

    final CachedClass declClass = cachedMethod.getDeclaringClass();
    final CallSiteClassLoader callSiteLoader = declClass.getCallSiteLoader();
    final String name = callSiteLoader.createClassName(cachedMethod.getName());

    final byte[] bytes = genStaticMetaMethodSite(cachedMethod, cw, name);

    return callSiteLoader.defineClassAndGetConstructor(name, bytes);
}