예제 #1
0
  protected void markProgramClassBody(ProgramClass programClass) {
    // Mark this class's name.
    markConstant(programClass, programClass.u2thisClass);

    // Mark the superclass.
    if (programClass.u2superClass != 0) {
      markConstant(programClass, programClass.u2superClass);
    }

    // Give the interfaces preliminary marks.
    programClass.hierarchyAccept(false, false, true, false, interfaceUsageMarker);

    // Explicitly mark the <clinit> method.
    programClass.methodAccept(
        ClassConstants.INTERNAL_METHOD_NAME_CLINIT,
        ClassConstants.INTERNAL_METHOD_TYPE_CLINIT,
        this);

    // Explicitly mark the parameterless <init> method.
    programClass.methodAccept(
        ClassConstants.INTERNAL_METHOD_NAME_INIT, ClassConstants.INTERNAL_METHOD_TYPE_INIT, this);

    // Process all class members that have already been marked as possibly used.
    programClass.fieldsAccept(possiblyUsedMemberUsageMarker);
    programClass.methodsAccept(possiblyUsedMemberUsageMarker);

    // Mark the attributes.
    programClass.attributesAccept(this);
  }
  public void visitProgramClass(ProgramClass programClass) {
    // Visit the constant pool entries.
    programClass.constantPoolEntriesAccept(this);

    // Visit the fields and methods.
    programClass.fieldsAccept(this);
    programClass.methodsAccept(this);

    // Visit the attributes.
    programClass.attributesAccept(this);
  }