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

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

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

Bytecode.setMaxStack介绍

[英]Sets max_stack.

This value may be automatically updated when an instruction is appended. A Bytecode object maintains the current stack depth whenever an instruction is added by addOpcode(). For example, if DUP is appended, the current stack depth is increased by one. If the new stack depth is more than max_stack, then it is assigned to max_stack. However, if branch instructions are appended, the current stack depth may not be correctly maintained.
[中]设置max_stack
追加指令时,此值可能会自动更新。Bytecode对象在addOpcode()添加指令时保持当前堆栈深度。例如,如果附加了DUP,则当前堆栈深度将增加1。如果新堆栈深度大于max_stack,则将其分配给max_stack。但是,如果附加了分支指令,则可能无法正确保持当前堆栈深度。

代码示例

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

code.setMaxStack(stacksize);
return code;

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

code.setMaxStack(stacksize);
return code;

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());

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

if (m == null) {
  code.add(Bytecode.RETURN);
  code.setMaxStack(stacksize);
  code.setMaxLocals(localsize);
  m = new MethodInfo(cf.getConstPool(), "<clinit>", "()V");

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());

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

if (m == null) {
  code.add(Bytecode.RETURN);
  code.setMaxStack(stacksize);
  code.setMaxLocals(localsize);
  m = new MethodInfo(cf.getConstPool(), "<clinit>", "()V");

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

static Bytecode makeBody(CtClass clazz, ClassFile classfile,
             CtMethod wrappedBody,
             CtClass[] parameters,
             CtClass returnType,
             ConstParameter cparam)
  throws CannotCompileException
{
  boolean isStatic = Modifier.isStatic(wrappedBody.getModifiers());
  Bytecode code = new Bytecode(classfile.getConstPool(), 0, 0);
  int stacksize = makeBody0(clazz, classfile, wrappedBody, isStatic,
               parameters, returnType, cparam, code);
  code.setMaxStack(stacksize);
  code.setMaxLocals(isStatic, parameters, 0);
  return code;
}

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

code.setMaxStack(stacksize);
return code;

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());
return new CtMethod(minfo, declaring);

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());
return new CtMethod(minfo, declaring);

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

if (m == null) {
  code.add(Bytecode.RETURN);
  code.setMaxStack(stacksize);
  code.setMaxLocals(localsize);
  m = new MethodInfo(cf.getConstPool(), "<clinit>", "()V");

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());

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

code.setMaxStack(s < 2 ? 2 : s); // for a 2-word return value
minfo.setCodeAttribute(code.toCodeAttribute());

相关文章