Exemple #1
0
  /** Translate Java bytecode to AVM2 bytecode */
  private void translateCode(AVM2MethodBody body) {

    // FIXME: handle abstract methods

    AVM2Code code = new AVM2Code(body.instructions);
    code.setupInitialScope();

    InstructionVisitor visitor = new InstructionVisitor(this);
    visitor.walk(clazz.javaClass, method);

    // FIXME: these values need further thought..
    // FIXME: could reduce the stack size if longs or doubles are involved
    CodeAttribute codeAttr = method.code();
    body.maxRegisters = codeAttr.maxLocals;
    body.maxStack = codeAttr.maxStack;
    body.maxScope = body.scopeDepth + 1;
  }
Exemple #2
0
 public void accept(InstructionVisitor insVisitor) {
   insVisitor.visit(this);
 }
 public void processWithVisitor(InstructionVisitor v) {
   v.visitInstrTry_Seq(this);
 }
 @Override
 public void accept(@NotNull InstructionVisitor visitor) {
   visitor.visitThrowExceptionInstruction(this);
 }