< prev index next >

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

Print this page




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

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


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



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


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

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


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



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




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


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


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


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


< prev index next >