javassist.bytecode.Bytecode.addStore()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(124)

本文整理了Java中javassist.bytecode.Bytecode.addStore()方法的一些代码示例,展示了Bytecode.addStore()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Bytecode.addStore()方法的具体详情如下:
包路径:javassist.bytecode.Bytecode
类名称:Bytecode
方法名:addStore

Bytecode.addStore介绍

[英]Appends an instruction for storing a value into the local variable at the index n.
[中]追加一条指令,用于将值存储到索引n处的局部变量中。

代码示例

代码示例来源:origin: redisson/redisson

private void makeCode2(Bytecode save, Bytecode load,
              int i, int n, CtClass[] paramTypes, int var)
  {
    if (i < n) {
      int size = load.addLoad(var, paramTypes[i]);
      makeCode2(save, load, i + 1, n, paramTypes, var + size);
      save.addStore(var, paramTypes[i]);
    }
    else
      locals = var - maxLocals;
  }
}

代码示例来源:origin: redisson/redisson

private static void storeStack0(int i, int n, CtClass[] params, int regno,
    Bytecode bytecode) {
  if (i >= n)
    return;
  else {
    CtClass c = params[i];
    int size;
    if (c instanceof CtPrimitiveType)
      size = ((CtPrimitiveType)c).getDataSize();
    else
      size = 1;
    storeStack0(i + 1, n, params, regno + size, bytecode);
    bytecode.addStore(regno, c);
  }
}

代码示例来源:origin: org.javassist/javassist

private static void storeStack0(int i, int n, CtClass[] params, int regno,
    Bytecode bytecode) {
  if (i >= n)
    return;
  CtClass c = params[i];
  int size;
  if (c instanceof CtPrimitiveType)
    size = ((CtPrimitiveType)c).getDataSize();
  else
    size = 1;
  storeStack0(i + 1, n, params, regno + size, bytecode);
  bytecode.addStore(regno, c);
}

代码示例来源:origin: org.javassist/javassist

private void makeCode2(Bytecode save, Bytecode load,
              int i, int n, CtClass[] paramTypes, int var)
  {
    if (i < n) {
      int size = load.addLoad(var, paramTypes[i]);
      makeCode2(save, load, i + 1, n, paramTypes, var + size);
      save.addStore(var, paramTypes[i]);
    }
    else
      locals = var - maxLocals;
  }
}

代码示例来源:origin: redisson/redisson

protected void atAssignParamList(CtClass[] params, Bytecode code)
  throws CompileError
{
  if (params == null)
    return;
  int varNo = indexOfParam1();
  int n = params.length;
  for (int i = 0; i < n; ++i) {
    code.addOpcode(DUP);
    code.addIconst(i);
    code.addOpcode(AALOAD);
    compileUnwrapValue(params[i], code);
    code.addStore(varNo, params[i]);
    varNo += is2word(exprType, arrayDim) ? 2 : 1;
  }
}

代码示例来源:origin: org.javassist/javassist

protected void atAssignParamList(CtClass[] params, Bytecode code)
  throws CompileError
{
  if (params == null)
    return;
  int varNo = indexOfParam1();
  int n = params.length;
  for (int i = 0; i < n; ++i) {
    code.addOpcode(DUP);
    code.addIconst(i);
    code.addOpcode(AALOAD);
    compileUnwrapValue(params[i], code);
    code.addStore(varNo, params[i]);
    varNo += is2word(exprType, arrayDim) ? 2 : 1;
  }
}

代码示例来源:origin: redisson/redisson

private int insertAfterAdvice(Bytecode code, Javac jv, String src,
               ConstPool cp, CtClass rtype, int varNo)
  throws CompileError
{
  int pc = code.currentPc();
  if (rtype == CtClass.voidType) {
    code.addOpcode(Opcode.ACONST_NULL);
    code.addAstore(varNo);
    jv.compileStmnt(src);
    code.addOpcode(Opcode.RETURN);
    if (code.getMaxLocals() < 1)
      code.setMaxLocals(1);
  }
  else {
    code.addStore(varNo, rtype);
    jv.compileStmnt(src);
    code.addLoad(varNo, rtype);
    if (rtype.isPrimitive())
      code.addOpcode(((CtPrimitiveType)rtype).getReturnOp());
    else
      code.addOpcode(Opcode.ARETURN);
  }
  return code.currentPc() - pc;
}

代码示例来源:origin: org.javassist/javassist

private int insertAfterAdvice(Bytecode code, Javac jv, String src,
               ConstPool cp, CtClass rtype, int varNo)
  throws CompileError
{
  int pc = code.currentPc();
  if (rtype == CtClass.voidType) {
    code.addOpcode(Opcode.ACONST_NULL);
    code.addAstore(varNo);
    jv.compileStmnt(src);
    code.addOpcode(Opcode.RETURN);
    if (code.getMaxLocals() < 1)
      code.setMaxLocals(1);
  }
  else {
    code.addStore(varNo, rtype);
    jv.compileStmnt(src);
    code.addLoad(varNo, rtype);
    if (rtype.isPrimitive())
      code.addOpcode(((CtPrimitiveType)rtype).getReturnOp());
    else
      code.addOpcode(Opcode.ARETURN);
  }
  return code.currentPc() - pc;
}

代码示例来源:origin: redisson/redisson

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: redisson/redisson

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: redisson/redisson

bytecode.addStore(retVar, newType);     // initialize $_

代码示例来源:origin: org.javassist/javassist

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: org.javassist/javassist

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: org.javassist/javassist

bytecode.addStore(retVar, newType);     // initialize $_

代码示例来源:origin: redisson/redisson

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: redisson/redisson

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: org.javassist/javassist

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: org.javassist/javassist

bytecode.addStore(retVar, retType);     // initialize $_

代码示例来源:origin: com.eclipsesource.jaxrs/jersey-all

private void makeCode2(Bytecode save, Bytecode load,
              int i, int n, CtClass[] paramTypes, int var)
  {
    if (i < n) {
      int size = load.addLoad(var, paramTypes[i]);
      makeCode2(save, load, i + 1, n, paramTypes, var + size);
      save.addStore(var, paramTypes[i]);
    }
    else
      locals = var - maxLocals;
  }
}

代码示例来源:origin: hstaudacher/osgi-jax-rs-connector

private void makeCode2(Bytecode save, Bytecode load,
              int i, int n, CtClass[] paramTypes, int var)
  {
    if (i < n) {
      int size = load.addLoad(var, paramTypes[i]);
      makeCode2(save, load, i + 1, n, paramTypes, var + size);
      save.addStore(var, paramTypes[i]);
    }
    else
      locals = var - maxLocals;
  }
}

相关文章