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

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

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

Bytecode.getMaxLocals介绍

[英]Gets max_locals.
[中]获取max_locals

代码示例

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

public int getMaxLocals() { return bytecode.getMaxLocals(); }

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

public int getMaxLocals() { return bytecode.getMaxLocals(); }

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

protected void replace0(int pos, Bytecode bytecode, int size)
    throws BadBytecode {
  byte[] code = bytecode.get();
  edited = true;
  int gap = code.length - size;
  for (int i = 0; i < size; ++i)
    iterator.writeByte(NOP, pos + i);
  if (gap > 0)
    pos = iterator.insertGapAt(pos, gap, false).position;
  iterator.write(code, pos);
  iterator.insert(bytecode.getExceptionTable(), pos);
  maxLocals = bytecode.getMaxLocals();
  maxStack = bytecode.getMaxStack();
}

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

protected void replace0(int pos, Bytecode bytecode, int size)
    throws BadBytecode {
  byte[] code = bytecode.get();
  edited = true;
  int gap = code.length - size;
  for (int i = 0; i < size; ++i)
    iterator.writeByte(NOP, pos + i);
  if (gap > 0)
    pos = iterator.insertGapAt(pos, gap, false).position;
  iterator.write(code, pos);
  iterator.insert(bytecode.getExceptionTable(), pos);
  maxLocals = bytecode.getMaxLocals();
  maxStack = bytecode.getMaxStack();
}

代码示例来源: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

return 0;
int var = b.getMaxLocals();
b.incMaxLocals(1);
int pc = b.currentPc();

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

maxLocals = b.getMaxLocals();

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

return 0;
int var = b.getMaxLocals();
b.incMaxLocals(1);
int pc = b.currentPc();

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

final int var = bc.getMaxLocals();
bc.incMaxLocals(1);
bc.addOpcode(DUP);

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

jv.compileStmnt(src);
ca.setMaxStack(b.getMaxStack());
ca.setMaxLocals(b.getMaxLocals());
iterator.skipConstructor();
int pos = iterator.insertEx(b.get());

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

Bytecode b = jv.getBytecode();
int stack = b.getMaxStack();
int locals = b.getMaxLocals();

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

maxLocals = b.getMaxLocals();

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

jv.compileStmnt(src);
Bytecode b = jv.getBytecode();
int locals = b.getMaxLocals();
int stack = b.getMaxStack();
ca.setMaxLocals(locals);

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

final int var = bc.getMaxLocals();
bc.incMaxLocals(1);
bc.addOpcode(DUP);

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

jv.compileStmnt(src);
ca.setMaxStack(b.getMaxStack());
ca.setMaxLocals(b.getMaxLocals());
iterator.skipConstructor();
int pos = iterator.insertEx(b.get());

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

Bytecode b = jv.getBytecode();
int stack = b.getMaxStack();
int locals = b.getMaxLocals();

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

int locals = b.getMaxLocals();

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

int locals = b.getMaxLocals();

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

ca.setMaxLocals(b.getMaxLocals());
methodInfo.rebuildStackMapIf6(cc.getClassPool(), cc.getClassFile2());

相关文章