コード例 #1
0
  @SuppressWarnings("unchecked")
  void writeFooter() {
    LabelNode endL = new LabelNode();
    node.instructions.add(endL);

    for (LocalVariable variable : localVariables.values()) {
      String description =
          Type.getDescriptor(variable.getClazz() == null ? Object.class : variable.getClazz());
      if (variable.name.equals("~this")) {
        // if (variable.getClazz() != Memory.class && !clazz.statement.isTrait()) {
        description = "L" + clazz.entity.getCompiledInternalName() + ";";
        // }
      }

      node.localVariables.add(
          new LocalVariableNode(
              variable.name,
              description,
              null,
              variable.label == null ? labelStart : variable.label,
              variable.getEndLabel() == null ? endL : variable.getEndLabel(),
              variable.index));
    }

    // node.maxStack = this.stackMaxSize;  !!! we don't need this, see: ClassWriter.COMPUTE_FRAMES
    // node.maxLocals = this.localVariables.size();
  }