< prev index next >

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

Print this page
@@ -96,19 +96,28 @@
      public static final int ENUM         = 1<<14;
  
      /** Added in SE8, represents constructs implicitly declared in source. */
      public static final int MANDATED     = 1<<15;
  
+     /** Marks a type as a primitive class. We can't reuse the class file encoding (ACC_PRIMITIVE)
+      * since the latter shares its value (0x800) with ACC_STRICT (javac speak: STRICT_FP) and while
+      * STRICT_FP is not a valid flag for a class in the class file level, javac's ASTs flag a class
+      * as being STRICT_FP so as to propagate the FP strictness to methods of the class thereby causing
+      * a clash */
+     public static final int PRIMITIVE_CLASS  = 1<<16;
+ 
      public static final int StandardFlags = 0x0fff;
  
      // Because the following access flags are overloaded with other
      // bit positions, we translate them when reading and writing class
      // files into unique bits positions: ACC_SYNTHETIC <-> SYNTHETIC,
      // for example.
      public static final int ACC_SUPER    = 0x0020;
      public static final int ACC_BRIDGE   = 0x0040;
      public static final int ACC_VARARGS  = 0x0080;
+     public static final int ACC_VALUE    = 0x0100;
+     public static final int ACC_PRIMITIVE = 0x0800;
      public static final int ACC_MODULE   = 0x8000;
  
      /*****************************************
       * Internal compiler flags (no bits in the lower 16).
       *****************************************/

@@ -120,18 +129,30 @@
      /** Flag is set for a variable symbol if the variable's definition
       *  has an initializer part.
       */
      public static final int HASINIT          = 1<<18;
  
+     /** Flag is set for a class symbol if it defines one or more non-empty
+      *  instance initializer block(s). This is relevenat only for class symbols
+      *  that originate from source types. For binary types the instance initializer
+      *  blocks are "normalized" into the constructors.
+      */
+     public static final int HASINITBLOCK         = 1<<18;
+ 
+     /** Flag is set for a method symbol if it is an empty no-arg ctor.
+      *  i.e one that simply returns (jlO) or merely chains to a super's
+      *  EMPTYNOARGCONSTR
+      */
+     public static final int EMPTYNOARGCONSTR         = 1<<18;
+ 
      /** Flag is set for compiler-generated anonymous method symbols
       *  that `own' an initializer block.
       */
      public static final int BLOCK            = 1<<20;
  
-     /** Flag bit 21 is available. (used earlier to tag compiler-generated abstract methods that implement
-      *  an interface method (Miranda methods)).
-      */
+     /** Marks a type as a value class */
+     public static final int VALUE_CLASS  = 1<<21;
  
      /** Flag is set for nested classes that do not access instance members
       *  or `this' of an outer class and therefore don't need to be passed
       *  a this$n reference.  This value is currently set only for anonymous
       *  classes in superclass constructor calls.

@@ -393,12 +414,12 @@
  
      /** Modifier masks.
       */
      public static final int
          AccessFlags                       = PUBLIC | PROTECTED | PRIVATE,
-         LocalClassFlags                   = FINAL | ABSTRACT | STRICTFP | ENUM | SYNTHETIC,
-         StaticLocalFlags                  = LocalClassFlags | STATIC | INTERFACE,
+         LocalClassFlags                   = FINAL | ABSTRACT | ENUM | SYNTHETIC  | ACC_PRIMITIVE | ACC_VALUE,
+         StaticLocalClassFlags             = LocalClassFlags | STATIC | INTERFACE,
          MemberClassFlags                  = LocalClassFlags | INTERFACE | AccessFlags,
          MemberStaticClassFlags            = MemberClassFlags | STATIC,
          ClassFlags                        = LocalClassFlags | INTERFACE | PUBLIC | ANNOTATION,
          InterfaceVarFlags                 = FINAL | STATIC | PUBLIC,
          VarFlags                          = AccessFlags | FINAL | STATIC |

@@ -408,15 +429,17 @@
          MethodFlags                       = AccessFlags | ABSTRACT | STATIC | NATIVE |
                                              SYNCHRONIZED | FINAL | STRICTFP,
          RecordMethodFlags                 = AccessFlags | ABSTRACT | STATIC |
                                              SYNCHRONIZED | FINAL | STRICTFP;
      public static final long
-         ExtendedStandardFlags             = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED,
-         ExtendedMemberClassFlags          = (long)MemberClassFlags | SEALED | NON_SEALED,
-         ExtendedMemberStaticClassFlags    = (long) MemberStaticClassFlags | SEALED | NON_SEALED,
-         ExtendedClassFlags                = (long)ClassFlags | SEALED | NON_SEALED,
-         ModifierFlags                     = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED,
+         ExtendedStandardFlags             = (long)StandardFlags | DEFAULT | SEALED | NON_SEALED | PRIMITIVE_CLASS | VALUE_CLASS,
+         ExtendedMemberClassFlags          = (long)MemberClassFlags | SEALED | NON_SEALED | PRIMITIVE_CLASS | VALUE_CLASS,
+         ExtendedMemberStaticClassFlags    = (long) MemberStaticClassFlags | SEALED | NON_SEALED | PRIMITIVE_CLASS | VALUE_CLASS,
+         ExtendedClassFlags                = (long)ClassFlags | SEALED | NON_SEALED | PRIMITIVE_CLASS | VALUE_CLASS,
+         ExtendedLocalClassFlags           = (long) LocalClassFlags | PRIMITIVE_CLASS | VALUE_CLASS,
+         ExtendedStaticLocalClassFlags     = (long) StaticLocalClassFlags | PRIMITIVE_CLASS | VALUE_CLASS,
+         ModifierFlags                     = ((long)StandardFlags & ~INTERFACE) | DEFAULT | SEALED | NON_SEALED | PRIMITIVE_CLASS | VALUE_CLASS,
          InterfaceMethodMask               = ABSTRACT | PRIVATE | STATIC | PUBLIC | STRICTFP | DEFAULT,
          AnnotationTypeElementMask         = ABSTRACT | PUBLIC,
          LocalVarFlags                     = FINAL | PARAMETER,
          ReceiverParamFlags                = PARAMETER;
  

@@ -438,10 +461,12 @@
              if (0 != (flags & SYNCHRONIZED))
                                            modifiers.add(Modifier.SYNCHRONIZED);
              if (0 != (flags & NATIVE))    modifiers.add(Modifier.NATIVE);
              if (0 != (flags & STRICTFP))  modifiers.add(Modifier.STRICTFP);
              if (0 != (flags & DEFAULT))   modifiers.add(Modifier.DEFAULT);
+             if (0 != (flags & PRIMITIVE_CLASS))     modifiers.add(Modifier.PRIMITIVE);
+             if (0 != (flags & VALUE_CLASS))     modifiers.add(Modifier.VALUE);
              modifiers = Collections.unmodifiableSet(modifiers);
              modifierSets.put(flags, modifiers);
          }
          return modifiers;
      }

@@ -479,13 +504,17 @@
          BRIDGE(Flags.BRIDGE),
          SYNTHETIC(Flags.SYNTHETIC),
          ANNOTATION(Flags.ANNOTATION),
          DEPRECATED(Flags.DEPRECATED),
          HASINIT(Flags.HASINIT),
+         HASINITBLOCK(Flags.HASINITBLOCK),
+         EMPTYNOARGCONSTR(Flags.EMPTYNOARGCONSTR),
          BLOCK(Flags.BLOCK),
          ENUM(Flags.ENUM),
          MANDATED(Flags.MANDATED),
+         PRIMITIVE(Flags.PRIMITIVE_CLASS),
+         VALUE(Flags.VALUE_CLASS),
          NOOUTERTHIS(Flags.NOOUTERTHIS),
          EXISTS(Flags.EXISTS),
          COMPOUND(Flags.COMPOUND),
          CLASS_SEEN(Flags.CLASS_SEEN),
          SOURCE_SEEN(Flags.SOURCE_SEEN),
< prev index next >