src/share/classes/com/sun/tools/javac/code/Symtab.java

changeset 1603
6118072811e5
parent 1587
f1f605f85850
parent 1570
f91144b7da75
child 1620
3806171b52d8
     1.1 --- a/src/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Feb 21 12:23:27 2013 -0800
     1.2 +++ b/src/share/classes/com/sun/tools/javac/code/Symtab.java	Thu Feb 21 17:49:56 2013 -0800
     1.3 @@ -157,6 +157,7 @@
     1.4      public final Type deprecatedType;
     1.5      public final Type suppressWarningsType;
     1.6      public final Type inheritedType;
     1.7 +    public final Type profileType;
     1.8      public final Type proprietaryType;
     1.9      public final Type systemType;
    1.10      public final Type autoCloseableType;
    1.11 @@ -361,6 +362,22 @@
    1.12  
    1.13      }
    1.14  
    1.15 +    // Enter a synthetic class that is used to mark classes in ct.sym.
    1.16 +    // This class does not have a class file.
    1.17 +    private Type enterSyntheticAnnotation(String name) {
    1.18 +        ClassType type = (ClassType)enterClass(name);
    1.19 +        ClassSymbol sym = (ClassSymbol)type.tsym;
    1.20 +        sym.completer = null;
    1.21 +        sym.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
    1.22 +        sym.erasure_field = type;
    1.23 +        sym.members_field = new Scope(sym);
    1.24 +        type.typarams_field = List.nil();
    1.25 +        type.allparams_field = List.nil();
    1.26 +        type.supertype_field = annotationType;
    1.27 +        type.interfaces_field = List.nil();
    1.28 +        return type;
    1.29 +    }
    1.30 +
    1.31      /** Constructor; enters all predefined identifiers and operators
    1.32       *  into symbol table.
    1.33       */
    1.34 @@ -524,17 +541,13 @@
    1.35          // Enter a synthetic class that is used to mark internal
    1.36          // proprietary classes in ct.sym.  This class does not have a
    1.37          // class file.
    1.38 -        ClassType proprietaryType = (ClassType)enterClass("sun.Proprietary+Annotation");
    1.39 -        this.proprietaryType = proprietaryType;
    1.40 -        ClassSymbol proprietarySymbol = (ClassSymbol)proprietaryType.tsym;
    1.41 -        proprietarySymbol.completer = null;
    1.42 -        proprietarySymbol.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
    1.43 -        proprietarySymbol.erasure_field = proprietaryType;
    1.44 -        proprietarySymbol.members_field = new Scope(proprietarySymbol);
    1.45 -        proprietaryType.typarams_field = List.nil();
    1.46 -        proprietaryType.allparams_field = List.nil();
    1.47 -        proprietaryType.supertype_field = annotationType;
    1.48 -        proprietaryType.interfaces_field = List.nil();
    1.49 +        proprietaryType = enterSyntheticAnnotation("sun.Proprietary+Annotation");
    1.50 +
    1.51 +        // Enter a synthetic class that is used to provide profile info for
    1.52 +        // classes in ct.sym.  This class does not have a class file.
    1.53 +        profileType = enterSyntheticAnnotation("jdk.Profile+Annotation");
    1.54 +        MethodSymbol m = new MethodSymbol(PUBLIC | ABSTRACT, names.value, intType, profileType.tsym);
    1.55 +        profileType.tsym.members().enter(m);
    1.56  
    1.57          // Enter a class for arrays.
    1.58          // The class implements java.lang.Cloneable and java.io.Serializable.

mercurial