当前位置: 首页>>代码示例>>Java>>正文


Java MethodVisitor.visitInvokeDynamicInsn方法代码示例

本文整理汇总了Java中jdk.internal.org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn方法的典型用法代码示例。如果您正苦于以下问题:Java MethodVisitor.visitInvokeDynamicInsn方法的具体用法?Java MethodVisitor.visitInvokeDynamicInsn怎么用?Java MethodVisitor.visitInvokeDynamicInsn使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jdk.internal.org.objectweb.asm.MethodVisitor的用法示例。


在下文中一共展示了MethodVisitor.visitInvokeDynamicInsn方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getClassFile

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
static byte[] getClassFile(String suffix) {
    ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
    MethodVisitor mv;
    cw.visit(52, ACC_PUBLIC | ACC_SUPER, CLASS_NAME + suffix, null, "java/lang/Object", null);
    {
        mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, METHOD_NAME, TYPE.toMethodDescriptorString(), null, null);
        mv.visitCode();
        Handle bsm = new Handle(H_INVOKESTATIC,
                CallSiteDepContextTest.class.getName().replace(".", "/"),
                "bootstrap",
                bsmMH.type().toMethodDescriptorString());
        mv.visitInvokeDynamicInsn("methodName", TYPE.toMethodDescriptorString(), bsm);
        mv.visitInsn(IRETURN);
        mv.visitMaxs(0, 0);
        mv.visitEnd();
    }
    cw.visitEnd();
    return cw.toByteArray();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:20,代码来源:CallSiteDepContextTest.java

示例2: add

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type add(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(IADD);
    } else {
        method.visitInvokeDynamicInsn("iadd", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IntType.java

示例3: sub

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type sub(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(ISUB);
    } else {
        method.visitInvokeDynamicInsn("isub", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IntType.java

示例4: mul

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type mul(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(IMUL);
    } else {
        method.visitInvokeDynamicInsn("imul", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IntType.java

示例5: div

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type div(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        JSType.DIV_ZERO.invoke(method);
    } else {
        method.visitInvokeDynamicInsn("idiv", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IntType.java

示例6: rem

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type rem(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        JSType.REM_ZERO.invoke(method);
    } else {
        method.visitInvokeDynamicInsn("irem", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IntType.java

示例7: neg

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type neg(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(INEG);
    } else {
        method.visitInvokeDynamicInsn("ineg", "(I)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:IntType.java

示例8: add

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type add(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(LADD);
    } else {
        method.visitInvokeDynamicInsn("ladd", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LongType.java

示例9: sub

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type sub(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(LSUB);
    } else {
        method.visitInvokeDynamicInsn("lsub", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LongType.java

示例10: mul

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type mul(final MethodVisitor method, final int programPoint) {
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(LMUL);
    } else {
        method.visitInvokeDynamicInsn("lmul", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LongType.java

示例11: div

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type div(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        JSType.DIV_ZERO_LONG.invoke(method);
    } else {
        method.visitInvokeDynamicInsn("ldiv", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LongType.java

示例12: rem

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type rem(final MethodVisitor method, final int programPoint) {
    if (programPoint == INVALID_PROGRAM_POINT) {
        JSType.REM_ZERO_LONG.invoke(method);
    } else {
        method.visitInvokeDynamicInsn("lrem", "(JJ)J", MATHBOOTSTRAP, programPoint);
    }
    return LONG;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:10,代码来源:LongType.java

示例13: add

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public Type add(final MethodVisitor method, final int programPoint) {
    // Adding booleans in JavaScript is perfectly valid, they add as if false=0 and true=1
    if(programPoint == INVALID_PROGRAM_POINT) {
        method.visitInsn(IADD);
    } else {
        method.visitInvokeDynamicInsn("iadd", "(II)I", MATHBOOTSTRAP, programPoint);
    }
    return INT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:BooleanType.java

示例14: defineIndyCallingClass

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
void defineIndyCallingClass(ClassWriter cw) {
    cw.visit(52, ACC_SUPER | ACC_PUBLIC, INDY_CALLER_CLASS_NAME, null, "java/lang/Object", null);
    MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "invoke", "()V", null, null);
    mv.visitCode();
    Handle h = new Handle(H_INVOKESTATIC,
                          BOOTSTRAP_METHOD_CLASS_NAME, BOOTSTRAP_METHOD_NAME,
                          BOOTSTRAP_METHOD_DESC, false);
    mv.visitInvokeDynamicInsn(BOOTSTRAP_METHOD_CLASS_NAME, "()V", h);
    mv.visitInsn(RETURN);
    mv.visitMaxs(0, 0);
    mv.visitEnd();
    cw.visitEnd();
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:14,代码来源:BootstrapMethodErrorTest.java

示例15: accept

import jdk.internal.org.objectweb.asm.MethodVisitor; //导入方法依赖的package包/类
@Override
public void accept(final MethodVisitor mv) {
    mv.visitInvokeDynamicInsn(name, desc, bsm, bsmArgs);
    acceptAnnotations(mv);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:6,代码来源:InvokeDynamicInsnNode.java


注:本文中的jdk.internal.org.objectweb.asm.MethodVisitor.visitInvokeDynamicInsn方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。