< prev index next >

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

Print this page




 143     /** A value for the unknown type. */
 144     public final Type unknownType;
 145 
 146     /** The builtin type of all arrays. */
 147     public final ClassSymbol arrayClass;
 148     public final MethodSymbol arrayCloneMethod;
 149 
 150     /** VGJ: The (singleton) type of all bound types. */
 151     public final ClassSymbol boundClass;
 152 
 153     /** The builtin type of all methods. */
 154     public final ClassSymbol methodClass;
 155 
 156     /** A symbol for the java.base module.
 157      */
 158     public final ModuleSymbol java_base;
 159 
 160     /** Predefined types.
 161      */
 162     public final Type objectType;



 163     public final Type objectsType;
 164     public final Type classType;
 165     public final Type classLoaderType;
 166     public final Type stringType;
 167     public final Type stringBufferType;
 168     public final Type stringBuilderType;
 169     public final Type cloneableType;
 170     public final Type serializableType;
 171     public final Type serializedLambdaType;
 172     public final Type varHandleType;
 173     public final Type methodHandleType;
 174     public final Type methodHandleLookupType;
 175     public final Type methodTypeType;
 176     public final Type nativeHeaderType;
 177     public final Type throwableType;
 178     public final Type errorType;
 179     public final Type interruptedExceptionType;
 180     public final Type illegalArgumentExceptionType;
 181     public final Type exceptionType;
 182     public final Type runtimeExceptionType;


 196     public final Type iterableType;
 197     public final Type iteratorType;
 198     public final Type annotationTargetType;
 199     public final Type overrideType;
 200     public final Type retentionType;
 201     public final Type deprecatedType;
 202     public final Type suppressWarningsType;
 203     public final Type supplierType;
 204     public final Type inheritedType;
 205     public final Type profileType;
 206     public final Type proprietaryType;
 207     public final Type systemType;
 208     public final Type autoCloseableType;
 209     public final Type trustMeType;
 210     public final Type lambdaMetafactory;
 211     public final Type stringConcatFactory;
 212     public final Type repeatableType;
 213     public final Type documentedType;
 214     public final Type elementTypeType;
 215     public final Type functionalInterfaceType;

 216 
 217     /** The symbol representing the length field of an array.
 218      */
 219     public final VarSymbol lengthVar;
 220 
 221     /** The symbol representing the final finalize method on enums */
 222     public final MethodSymbol enumFinalFinalize;
 223 
 224     /** The symbol representing the close method on TWR AutoCloseable type */
 225     public final MethodSymbol autoCloseableClose;
 226 
 227     /** The predefined type that belongs to a tag.
 228      */
 229     public final Type[] typeOfTag = new Type[TypeTag.getTypeTagCount()];
 230 
 231     /** The name of the class that belongs to a basic type tag.
 232      */
 233     public final Name[] boxedName = new Name[TypeTag.getTypeTagCount()];
 234 
 235     /** A hashtable containing the encountered top-level and member classes,


 488         scope.enter(errType.tsym);
 489 
 490         // Enter symbol for the errSymbol
 491         scope.enter(errSymbol);
 492 
 493         Source source = Source.instance(context);
 494         if (Feature.MODULES.allowedInSource(source)) {
 495             java_base = enterModule(names.java_base);
 496             //avoid completing java.base during the Symtab initialization
 497             java_base.completer = Completer.NULL_COMPLETER;
 498             java_base.visiblePackages = Collections.emptyMap();
 499         } else {
 500             java_base = noModule;
 501         }
 502 
 503         // Get the initial completer for ModuleSymbols from Modules
 504         moduleCompleter = Modules.instance(context).getCompleter();
 505 
 506         // Enter predefined classes. All are assumed to be in the java.base module.
 507         objectType = enterClass("java.lang.Object");



 508         objectsType = enterClass("java.util.Objects");
 509         classType = enterClass("java.lang.Class");
 510         stringType = enterClass("java.lang.String");
 511         stringBufferType = enterClass("java.lang.StringBuffer");
 512         stringBuilderType = enterClass("java.lang.StringBuilder");
 513         cloneableType = enterClass("java.lang.Cloneable");
 514         throwableType = enterClass("java.lang.Throwable");
 515         serializableType = enterClass("java.io.Serializable");
 516         serializedLambdaType = enterClass("java.lang.invoke.SerializedLambda");
 517         varHandleType = enterClass("java.lang.invoke.VarHandle");
 518         methodHandleType = enterClass("java.lang.invoke.MethodHandle");
 519         methodHandleLookupType = enterClass("java.lang.invoke.MethodHandles$Lookup");
 520         methodTypeType = enterClass("java.lang.invoke.MethodType");
 521         errorType = enterClass("java.lang.Error");
 522         illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
 523         interruptedExceptionType = enterClass("java.lang.InterruptedException");
 524         exceptionType = enterClass("java.lang.Exception");
 525         runtimeExceptionType = enterClass("java.lang.RuntimeException");
 526         classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException");
 527         noClassDefFoundErrorType = enterClass("java.lang.NoClassDefFoundError");


 550         retentionType = enterClass("java.lang.annotation.Retention");
 551         deprecatedType = enterClass("java.lang.Deprecated");
 552         suppressWarningsType = enterClass("java.lang.SuppressWarnings");
 553         supplierType = enterClass("java.util.function.Supplier");
 554         inheritedType = enterClass("java.lang.annotation.Inherited");
 555         repeatableType = enterClass("java.lang.annotation.Repeatable");
 556         documentedType = enterClass("java.lang.annotation.Documented");
 557         elementTypeType = enterClass("java.lang.annotation.ElementType");
 558         systemType = enterClass("java.lang.System");
 559         autoCloseableType = enterClass("java.lang.AutoCloseable");
 560         autoCloseableClose = new MethodSymbol(PUBLIC,
 561                              names.close,
 562                              new MethodType(List.nil(), voidType,
 563                                             List.of(exceptionType), methodClass),
 564                              autoCloseableType.tsym);
 565         trustMeType = enterClass("java.lang.SafeVarargs");
 566         nativeHeaderType = enterClass("java.lang.annotation.Native");
 567         lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory");
 568         stringConcatFactory = enterClass("java.lang.invoke.StringConcatFactory");
 569         functionalInterfaceType = enterClass("java.lang.FunctionalInterface");

 570 
 571         synthesizeEmptyInterfaceIfMissing(autoCloseableType);
 572         synthesizeEmptyInterfaceIfMissing(cloneableType);
 573         synthesizeEmptyInterfaceIfMissing(serializableType);
 574         synthesizeEmptyInterfaceIfMissing(lambdaMetafactory);
 575         synthesizeEmptyInterfaceIfMissing(serializedLambdaType);
 576         synthesizeEmptyInterfaceIfMissing(stringConcatFactory);
 577         synthesizeBoxTypeIfMissing(doubleType);
 578         synthesizeBoxTypeIfMissing(floatType);
 579         synthesizeBoxTypeIfMissing(voidType);
 580 
 581         // Enter a synthetic class that is used to mark internal
 582         // proprietary classes in ct.sym.  This class does not have a
 583         // class file.
 584         proprietaryType = enterSyntheticAnnotation("sun.Proprietary+Annotation");
 585 
 586         // Enter a synthetic class that is used to provide profile info for
 587         // classes in ct.sym.  This class does not have a class file.
 588         profileType = enterSyntheticAnnotation("jdk.Profile+Annotation");
 589         MethodSymbol m = new MethodSymbol(PUBLIC | ABSTRACT, names.value, intType, profileType.tsym);




 143     /** A value for the unknown type. */
 144     public final Type unknownType;
 145 
 146     /** The builtin type of all arrays. */
 147     public final ClassSymbol arrayClass;
 148     public final MethodSymbol arrayCloneMethod;
 149 
 150     /** VGJ: The (singleton) type of all bound types. */
 151     public final ClassSymbol boundClass;
 152 
 153     /** The builtin type of all methods. */
 154     public final ClassSymbol methodClass;
 155 
 156     /** A symbol for the java.base module.
 157      */
 158     public final ModuleSymbol java_base;
 159 
 160     /** Predefined types.
 161      */
 162     public final Type objectType;
 163     public final Type abstractRecordType;
 164     public final Type dataAnnotationType;
 165     public final Type objectMethodBuildersType;
 166     public final Type objectsType;
 167     public final Type classType;
 168     public final Type classLoaderType;
 169     public final Type stringType;
 170     public final Type stringBufferType;
 171     public final Type stringBuilderType;
 172     public final Type cloneableType;
 173     public final Type serializableType;
 174     public final Type serializedLambdaType;
 175     public final Type varHandleType;
 176     public final Type methodHandleType;
 177     public final Type methodHandleLookupType;
 178     public final Type methodTypeType;
 179     public final Type nativeHeaderType;
 180     public final Type throwableType;
 181     public final Type errorType;
 182     public final Type interruptedExceptionType;
 183     public final Type illegalArgumentExceptionType;
 184     public final Type exceptionType;
 185     public final Type runtimeExceptionType;


 199     public final Type iterableType;
 200     public final Type iteratorType;
 201     public final Type annotationTargetType;
 202     public final Type overrideType;
 203     public final Type retentionType;
 204     public final Type deprecatedType;
 205     public final Type suppressWarningsType;
 206     public final Type supplierType;
 207     public final Type inheritedType;
 208     public final Type profileType;
 209     public final Type proprietaryType;
 210     public final Type systemType;
 211     public final Type autoCloseableType;
 212     public final Type trustMeType;
 213     public final Type lambdaMetafactory;
 214     public final Type stringConcatFactory;
 215     public final Type repeatableType;
 216     public final Type documentedType;
 217     public final Type elementTypeType;
 218     public final Type functionalInterfaceType;
 219     public final Type extractorType;
 220 
 221     /** The symbol representing the length field of an array.
 222      */
 223     public final VarSymbol lengthVar;
 224 
 225     /** The symbol representing the final finalize method on enums */
 226     public final MethodSymbol enumFinalFinalize;
 227 
 228     /** The symbol representing the close method on TWR AutoCloseable type */
 229     public final MethodSymbol autoCloseableClose;
 230 
 231     /** The predefined type that belongs to a tag.
 232      */
 233     public final Type[] typeOfTag = new Type[TypeTag.getTypeTagCount()];
 234 
 235     /** The name of the class that belongs to a basic type tag.
 236      */
 237     public final Name[] boxedName = new Name[TypeTag.getTypeTagCount()];
 238 
 239     /** A hashtable containing the encountered top-level and member classes,


 492         scope.enter(errType.tsym);
 493 
 494         // Enter symbol for the errSymbol
 495         scope.enter(errSymbol);
 496 
 497         Source source = Source.instance(context);
 498         if (Feature.MODULES.allowedInSource(source)) {
 499             java_base = enterModule(names.java_base);
 500             //avoid completing java.base during the Symtab initialization
 501             java_base.completer = Completer.NULL_COMPLETER;
 502             java_base.visiblePackages = Collections.emptyMap();
 503         } else {
 504             java_base = noModule;
 505         }
 506 
 507         // Get the initial completer for ModuleSymbols from Modules
 508         moduleCompleter = Modules.instance(context).getCompleter();
 509 
 510         // Enter predefined classes. All are assumed to be in the java.base module.
 511         objectType = enterClass("java.lang.Object");
 512         abstractRecordType = enterClass("java.lang.AbstractRecord");
 513         dataAnnotationType = enterClass("java.lang.annotation.Data");
 514         objectMethodBuildersType = enterClass("java.lang.invoke.ObjectMethodBuilders");
 515         objectsType = enterClass("java.util.Objects");
 516         classType = enterClass("java.lang.Class");
 517         stringType = enterClass("java.lang.String");
 518         stringBufferType = enterClass("java.lang.StringBuffer");
 519         stringBuilderType = enterClass("java.lang.StringBuilder");
 520         cloneableType = enterClass("java.lang.Cloneable");
 521         throwableType = enterClass("java.lang.Throwable");
 522         serializableType = enterClass("java.io.Serializable");
 523         serializedLambdaType = enterClass("java.lang.invoke.SerializedLambda");
 524         varHandleType = enterClass("java.lang.invoke.VarHandle");
 525         methodHandleType = enterClass("java.lang.invoke.MethodHandle");
 526         methodHandleLookupType = enterClass("java.lang.invoke.MethodHandles$Lookup");
 527         methodTypeType = enterClass("java.lang.invoke.MethodType");
 528         errorType = enterClass("java.lang.Error");
 529         illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
 530         interruptedExceptionType = enterClass("java.lang.InterruptedException");
 531         exceptionType = enterClass("java.lang.Exception");
 532         runtimeExceptionType = enterClass("java.lang.RuntimeException");
 533         classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException");
 534         noClassDefFoundErrorType = enterClass("java.lang.NoClassDefFoundError");


 557         retentionType = enterClass("java.lang.annotation.Retention");
 558         deprecatedType = enterClass("java.lang.Deprecated");
 559         suppressWarningsType = enterClass("java.lang.SuppressWarnings");
 560         supplierType = enterClass("java.util.function.Supplier");
 561         inheritedType = enterClass("java.lang.annotation.Inherited");
 562         repeatableType = enterClass("java.lang.annotation.Repeatable");
 563         documentedType = enterClass("java.lang.annotation.Documented");
 564         elementTypeType = enterClass("java.lang.annotation.ElementType");
 565         systemType = enterClass("java.lang.System");
 566         autoCloseableType = enterClass("java.lang.AutoCloseable");
 567         autoCloseableClose = new MethodSymbol(PUBLIC,
 568                              names.close,
 569                              new MethodType(List.nil(), voidType,
 570                                             List.of(exceptionType), methodClass),
 571                              autoCloseableType.tsym);
 572         trustMeType = enterClass("java.lang.SafeVarargs");
 573         nativeHeaderType = enterClass("java.lang.annotation.Native");
 574         lambdaMetafactory = enterClass("java.lang.invoke.LambdaMetafactory");
 575         stringConcatFactory = enterClass("java.lang.invoke.StringConcatFactory");
 576         functionalInterfaceType = enterClass("java.lang.FunctionalInterface");
 577         extractorType = enterClass("java.lang.compiler.Extractor");
 578 
 579         synthesizeEmptyInterfaceIfMissing(autoCloseableType);
 580         synthesizeEmptyInterfaceIfMissing(cloneableType);
 581         synthesizeEmptyInterfaceIfMissing(serializableType);
 582         synthesizeEmptyInterfaceIfMissing(lambdaMetafactory);
 583         synthesizeEmptyInterfaceIfMissing(serializedLambdaType);
 584         synthesizeEmptyInterfaceIfMissing(stringConcatFactory);
 585         synthesizeBoxTypeIfMissing(doubleType);
 586         synthesizeBoxTypeIfMissing(floatType);
 587         synthesizeBoxTypeIfMissing(voidType);
 588 
 589         // Enter a synthetic class that is used to mark internal
 590         // proprietary classes in ct.sym.  This class does not have a
 591         // class file.
 592         proprietaryType = enterSyntheticAnnotation("sun.Proprietary+Annotation");
 593 
 594         // Enter a synthetic class that is used to provide profile info for
 595         // classes in ct.sym.  This class does not have a class file.
 596         profileType = enterSyntheticAnnotation("jdk.Profile+Annotation");
 597         MethodSymbol m = new MethodSymbol(PUBLIC | ABSTRACT, names.value, intType, profileType.tsym);


< prev index next >