Example #1
0
  /** Generate the method name */
  private void generateName() {
    AVM2Namespace namespace;

    switch (method.visibility()) {
      case PUBLIC:
        namespace = AVM2StandardNamespace.EmptyPackage.namespace;
        name = method.signature.name;

      case PRIVATE:
      case PROTECTED:
      case PACKAGE:
    }

    new AVM2QName(namespace, name);
  }
Example #2
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;
  }