Example usage for org.objectweb.asm.commons Method getMethod

List of usage examples for org.objectweb.asm.commons Method getMethod

Introduction

In this page you can find the example usage for org.objectweb.asm.commons Method getMethod.

Prototype

public static Method getMethod(final String method) 

Source Link

Document

Returns a Method corresponding to the given Java method declaration.

Usage

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void loadMethodPrameterLength() {
    //This is only called for methods with default args
    loadArg(1);//  w w  w.  j  a v  a2  s  .  co m
    invokeVirtual(Types.RUBY_ARRAY_TYPE, Method.getMethod("int size()"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyBlock_getCurrentMethod() {
    invokeVirtual(Types.RUBY_BLOCK_TYPE,
            Method.getMethod("com.xruby.runtime.lang.RubyMethod getCurrentMethod()"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void new_MethodClass(String methodName) {
    Type methodNameType = Type.getType("L" + methodName + ";");
    newInstance(methodNameType);/* www  .jav  a 2s  .c om*/
    dup();
    invokeConstructor(methodNameType, Method.getMethod("void <init> ()"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void new_BlockClass(ClassGenerator cg, String name, boolean is_in_class_builder,
        boolean is_in_singleton_method, boolean is_in_global_scope, boolean is_in_block) {
    Type methodNameType = Type.getType("L" + name + ";");
    newInstance(methodNameType);//from w w w  .  j a v  a 2  s.  c om
    dup();

    loadSelf(is_in_block);

    cg.loadArgOfMethodForBlock();

    if (is_in_global_scope) {
        pushNull();
    } else {
        loadBlock(is_in_block);
    }

    loadCurrentScope(is_in_class_builder, is_in_singleton_method, is_in_global_scope, is_in_block);

    if (is_in_block) {
        loadThis();
        RubyBlock_getCurrentMethod();
        push(true);
    } else if (is_in_global_scope || is_in_class_builder) {
        pushNull();
        push(false);
    } else {
        loadThis();
        push(false);
    }

    invokeConstructor(methodNameType, Method.getMethod(ClassGeneratorForRubyBlock.buildContructorSignature()));

}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyArray_add(boolean is_method_call) {
    if (is_method_call) {
        invokeStatic(Types.RUBY_API_TYPE, Method.getMethod(
                "com.xruby.runtime.lang.RubyValue expandArrayIfThereIsZeroOrOneValue(com.xruby.runtime.lang.RubyValue)"));
    }/*from  ww w . j av  a  2  s .  c om*/
    invokeVirtual(Types.RUBY_ARRAY_TYPE,
            Method.getMethod("com.xruby.runtime.builtin.RubyArray add(com.xruby.runtime.lang.RubyValue)"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyArray_expand(boolean is_method_call) {
    if (is_method_call) {
        invokeStatic(Types.RUBY_API_TYPE, Method.getMethod(
                "com.xruby.runtime.lang.RubyValue expandArrayIfThereIsZeroOrOneValue(com.xruby.runtime.lang.RubyValue)"));
    }/* w ww  . j  a v  a 2s.c om*/

    invokeVirtual(Types.RUBY_ARRAY_TYPE,
            Method.getMethod("com.xruby.runtime.builtin.RubyArray expand(com.xruby.runtime.lang.RubyValue)"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyArray_get(int index) {
    push(index);/*from  ww  w  .j a v a 2  s . c o  m*/
    invokeVirtual(Types.RUBY_ARRAY_TYPE, Method.getMethod("com.xruby.runtime.lang.RubyValue get(int)"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyArray_collect(int index) {
    push(index);/*from  ww  w .j  av  a  2  s .co  m*/
    invokeVirtual(Types.RUBY_ARRAY_TYPE, Method.getMethod("com.xruby.runtime.lang.RubyValue collect(int)"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyString_append(String value) {
    push(value);//from  ww  w.  j av  a  2 s .c  o  m
    invokeVirtual(Types.RUBY_STRING_TYPE,
            Method.getMethod("com.xruby.runtime.builtin.RubyString appendString(String)"));
}

From source file:com.xruby.compiler.codegen.MethodGenerator.java

License:BSD License

public void RubyString_append() {
    invokeVirtual(Types.RUBY_STRING_TYPE, Method
            .getMethod("com.xruby.runtime.builtin.RubyString appendString(com.xruby.runtime.lang.RubyValue)"));
}