當前位置: 首頁>>代碼示例>>Java>>正文


Java MethodVisitor.visitVarInsn方法代碼示例

本文整理匯總了Java中org.mvel2.asm.MethodVisitor.visitVarInsn方法的典型用法代碼示例。如果您正苦於以下問題:Java MethodVisitor.visitVarInsn方法的具體用法?Java MethodVisitor.visitVarInsn怎麽用?Java MethodVisitor.visitVarInsn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.mvel2.asm.MethodVisitor的用法示例。


在下文中一共展示了MethodVisitor.visitVarInsn方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: _initJIT

import org.mvel2.asm.MethodVisitor; //導入方法依賴的package包/類
/**
 * Does all the boilerplate for initiating the JIT.
 */
private void _initJIT() {
    if (isAdvancedDebugging()) {
        buildLog = new StringAppender();
    }

    cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);

    synchronized (Runtime.getRuntime()) {
        cw.visit(OPCODES_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className = "ASMAccessorImpl_"
                + valueOf(cw.hashCode()).replaceAll("\\-", "_") + (System.currentTimeMillis() / 10) +
                ((int) Math.random() * 100),
                null, "java/lang/Object", new String[]{NAMESPACE + "compiler/Accessor"});
    }

    MethodVisitor m = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);

    m.visitCode();
    m.visitVarInsn(Opcodes.ALOAD, 0);
    m.visitMethodInsn(INVOKESPECIAL, "java/lang/Object",
            "<init>", "()V");
    m.visitInsn(RETURN);

    m.visitMaxs(1, 1);
    m.visitEnd();

    (mv = cw.visitMethod(ACC_PUBLIC, "getValue",
            "(Ljava/lang/Object;Ljava/lang/Object;L" + NAMESPACE
                    + "integration/VariableResolverFactory;)Ljava/lang/Object;", null, null)).visitCode();
}
 
開發者ID:codehaus,項目名稱:mvel,代碼行數:33,代碼來源:ASMAccessorOptimizer.java

示例2: _initJIT2

import org.mvel2.asm.MethodVisitor; //導入方法依賴的package包/類
private void _initJIT2() {
    if (isAdvancedDebugging()) {
        buildLog = new StringAppender();
    }

    cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);

    synchronized (Runtime.getRuntime()) {
        cw.visit(OPCODES_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className = "ASMAccessorImpl_"
                + valueOf(cw.hashCode()).replaceAll("\\-", "_") + (System.currentTimeMillis() / 10) +
                ((int) Math.random() * 100),
                null, "java/lang/Object", new String[]{NAMESPACE + "compiler/Accessor"});
    }

    MethodVisitor m = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);

    m.visitCode();
    m.visitVarInsn(Opcodes.ALOAD, 0);
    m.visitMethodInsn(INVOKESPECIAL, "java/lang/Object",
            "<init>", "()V");
    m.visitInsn(RETURN);

    m.visitMaxs(1, 1);
    m.visitEnd();

    (mv = cw.visitMethod(ACC_PUBLIC, "setValue",
            "(Ljava/lang/Object;Ljava/lang/Object;L" + NAMESPACE
                    + "integration/VariableResolverFactory;Ljava/lang/Object;)Ljava/lang/Object;", null, null)).visitCode();
}
 
開發者ID:codehaus,項目名稱:mvel,代碼行數:30,代碼來源:ASMAccessorOptimizer.java

示例3: _initJIT

import org.mvel2.asm.MethodVisitor; //導入方法依賴的package包/類
/**
 * Does all the boilerplate for initiating the JIT.
 */
private void _initJIT() {
  if (isAdvancedDebugging()) {
    buildLog = new StringAppender();
  }

  cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);

  synchronized (Runtime.getRuntime()) {
    cw.visit(OPCODES_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className = "ASMAccessorImpl_"
        + valueOf(cw.hashCode()).replaceAll("\\-", "_") + (System.currentTimeMillis() / 10) +
        ((int) Math.random() * 100),
        null, "java/lang/Object", new String[]{NAMESPACE + "compiler/Accessor"});
  }

  MethodVisitor m = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);

  m.visitCode();
  m.visitVarInsn(Opcodes.ALOAD, 0);
  m.visitMethodInsn(INVOKESPECIAL, "java/lang/Object",
      "<init>", "()V");
  m.visitInsn(RETURN);

  m.visitMaxs(1, 1);
  m.visitEnd();

  (mv = cw.visitMethod(ACC_PUBLIC, "getValue",
      "(Ljava/lang/Object;Ljava/lang/Object;L" + NAMESPACE
          + "integration/VariableResolverFactory;)Ljava/lang/Object;", null, null)).visitCode();
}
 
開發者ID:osswangxining,項目名稱:mvel-jsr223,代碼行數:33,代碼來源:ASMAccessorOptimizer.java

示例4: _initJIT2

import org.mvel2.asm.MethodVisitor; //導入方法依賴的package包/類
private void _initJIT2() {
  if (isAdvancedDebugging()) {
    buildLog = new StringAppender();
  }

  cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + ClassWriter.COMPUTE_FRAMES);

  synchronized (Runtime.getRuntime()) {
    cw.visit(OPCODES_VERSION, Opcodes.ACC_PUBLIC + Opcodes.ACC_SUPER, className = "ASMAccessorImpl_"
        + valueOf(cw.hashCode()).replaceAll("\\-", "_") + (System.currentTimeMillis() / 10) +
        ((int) Math.random() * 100),
        null, "java/lang/Object", new String[]{NAMESPACE + "compiler/Accessor"});
  }

  MethodVisitor m = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null);

  m.visitCode();
  m.visitVarInsn(Opcodes.ALOAD, 0);
  m.visitMethodInsn(INVOKESPECIAL, "java/lang/Object",
      "<init>", "()V");
  m.visitInsn(RETURN);

  m.visitMaxs(1, 1);
  m.visitEnd();

  (mv = cw.visitMethod(ACC_PUBLIC, "setValue",
      "(Ljava/lang/Object;Ljava/lang/Object;L" + NAMESPACE
          + "integration/VariableResolverFactory;Ljava/lang/Object;)Ljava/lang/Object;", null, null)).visitCode();
}
 
開發者ID:osswangxining,項目名稱:mvel-jsr223,代碼行數:30,代碼來源:ASMAccessorOptimizer.java

示例5: accept

import org.mvel2.asm.MethodVisitor; //導入方法依賴的package包/類
@Override
public void accept(final MethodVisitor mv) {
    mv.visitVarInsn(opcode, var);
    acceptAnnotations(mv);
}
 
開發者ID:osswangxining,項目名稱:mvel-jsr223,代碼行數:6,代碼來源:VarInsnNode.java


注:本文中的org.mvel2.asm.MethodVisitor.visitVarInsn方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。