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

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

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

Bytecode.addMultiNewarray介绍

[英]Appends MULTINEWARRAY.
[中]追加多维数组。

代码示例

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

int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

/**
 * Appends MULTINEWARRAY.
 *
 * @param clazz             the array type.
 * @param dimensions        the sizes of all dimensions.
 * @return          the length of <code>dimensions</code>.
 */
public int addMultiNewarray(CtClass clazz, int[] dimensions) {
  int len = dimensions.length;
  for (int i = 0; i < len; ++i)
    addIconst(dimensions[i]);
  growStack(len);
  return addMultiNewarray(clazz, len);
}

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

@Override
  int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

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

/**
 * Appends MULTINEWARRAY.
 *
 * @param clazz             the array type.
 * @param dimensions        the sizes of all dimensions.
 * @return          the length of <code>dimensions</code>.
 */
public int addMultiNewarray(CtClass clazz, int[] dimensions) {
  int len = dimensions.length;
  for (int i = 0; i < len; ++i)
    addIconst(dimensions[i]);
  growStack(len);
  return addMultiNewarray(clazz, len);
}

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

@Override
int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

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

protected void atMultiNewArray(int type, ASTList classname, ASTList size)
  throws CompileError
{
  int count, dim;
  dim = size.length();
  for (count = 0; size != null; size = size.tail()) {
    ASTree s = size.head();
    if (s == null)
      break;          // int[][][] a = new int[3][4][];
    ++count;
    s.accept(this);
    if (exprType != INT)
      throw new CompileError("bad type for array size");
  }
  String desc;
  exprType = type;
  arrayDim = dim;
  if (type == CLASS) {
    className = resolveClassName(classname);
    desc = toJvmArrayName(className, dim);
  }
  else
    desc = toJvmTypeName(type, dim);
  bytecode.addMultiNewarray(desc, count);
}

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

protected void atMultiNewArray(int type, ASTList classname, ASTList size)
  throws CompileError
{
  int count, dim;
  dim = size.length();
  for (count = 0; size != null; size = size.tail()) {
    ASTree s = size.head();
    if (s == null)
      break;          // int[][][] a = new int[3][4][];
    ++count;
    s.accept(this);
    if (exprType != INT)
      throw new CompileError("bad type for array size");
  }
  String desc;
  exprType = type;
  arrayDim = dim;
  if (type == CLASS) {
    className = resolveClassName(classname);
    desc = toJvmArrayName(className, dim);
  }
  else
    desc = toJvmTypeName(type, dim);
  bytecode.addMultiNewarray(desc, count);
}

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

int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

int compileIfStatic(CtClass type, String name, Bytecode code,
            Javac drv) throws CannotCompileException
  {
    int s = code.addMultiNewarray(type, dim);
    code.addPutstatic(Bytecode.THIS, name, Descriptor.of(type));
    return s;   // stack size
  }
}

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

/**
 * Appends MULTINEWARRAY.
 *
 * @param clazz             the array type.
 * @param dimensions        the sizes of all dimensions.
 * @return          the length of <code>dimensions</code>.
 */
public int addMultiNewarray(CtClass clazz, int[] dimensions) {
  int len = dimensions.length;
  for (int i = 0; i < len; ++i)
    addIconst(dimensions[i]);
  growStack(len);
  return addMultiNewarray(clazz, len);
}

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

/**
 * Appends MULTINEWARRAY.
 *
 * @param clazz             the array type.
 * @param dimensions        the sizes of all dimensions.
 * @return          the length of <code>dimensions</code>.
 */
public int addMultiNewarray(CtClass clazz, int[] dimensions) {
  int len = dimensions.length;
  for (int i = 0; i < len; ++i)
    addIconst(dimensions[i]);
  growStack(len);
  return addMultiNewarray(clazz, len);
}

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

int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

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

int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

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

int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

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

int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

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

int compile(CtClass type, String name, Bytecode code,
      CtClass[] parameters, Javac drv)
  throws CannotCompileException
{
  code.addAload(0);
  int s = code.addMultiNewarray(type, dim);
  code.addPutfield(Bytecode.THIS, name, Descriptor.of(type));
  return s + 1;       // stack size
}

相关文章