src/share/classes/com/sun/tools/javac/jvm/Code.java

changeset 1374
c002fdee76fd
parent 1339
0e5899f09dab
child 1442
fcf89720ae71
     1.1 --- a/src/share/classes/com/sun/tools/javac/jvm/Code.java	Tue Oct 23 13:58:56 2012 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/javac/jvm/Code.java	Thu Oct 25 11:09:36 2012 -0700
     1.3 @@ -30,7 +30,8 @@
     1.4  import com.sun.tools.javac.util.*;
     1.5  import com.sun.tools.javac.util.JCDiagnostic.DiagnosticPosition;
     1.6  
     1.7 -import static com.sun.tools.javac.code.TypeTags.*;
     1.8 +import static com.sun.tools.javac.code.TypeTag.BOT;
     1.9 +import static com.sun.tools.javac.code.TypeTag.INT;
    1.10  import static com.sun.tools.javac.jvm.ByteCodes.*;
    1.11  import static com.sun.tools.javac.jvm.UninitializedType.*;
    1.12  import static com.sun.tools.javac.jvm.ClassWriter.StackMapTableFrame;
    1.13 @@ -224,7 +225,7 @@
    1.14       *  JVM architecture).
    1.15       */
    1.16      public static int typecode(Type type) {
    1.17 -        switch (type.tag) {
    1.18 +        switch (type.getTag()) {
    1.19          case BYTE: return BYTEcode;
    1.20          case SHORT: return SHORTcode;
    1.21          case CHAR: return CHARcode;
    1.22 @@ -242,7 +243,7 @@
    1.23          case UNINITIALIZED_THIS:
    1.24          case UNINITIALIZED_OBJECT:
    1.25              return OBJECTcode;
    1.26 -        default: throw new AssertionError("typecode " + type.tag);
    1.27 +        default: throw new AssertionError("typecode " + type.getTag());
    1.28          }
    1.29      }
    1.30  
    1.31 @@ -281,7 +282,7 @@
    1.32      /** Given a type, return its code for allocating arrays of that type.
    1.33       */
    1.34      public static int arraycode(Type type) {
    1.35 -        switch (type.tag) {
    1.36 +        switch (type.getTag()) {
    1.37          case BYTE: return 8;
    1.38          case BOOLEAN: return 4;
    1.39          case SHORT: return 9;
    1.40 @@ -477,7 +478,7 @@
    1.41              state.pop(1);
    1.42              //sometimes 'null type' is treated as a one-dimensional array type
    1.43              //see Gen.visitLiteral - we should handle this case accordingly
    1.44 -            Type stackType = a.tag == BOT ?
    1.45 +            Type stackType = a.hasTag(BOT) ?
    1.46                  syms.objectType :
    1.47                  types.erasure(types.elemtype(a));
    1.48              state.push(stackType); }
    1.49 @@ -1656,13 +1657,13 @@
    1.50  
    1.51          void push(Type t) {
    1.52              if (debugCode) System.err.println("   pushing " + t);
    1.53 -            switch (t.tag) {
    1.54 -            case TypeTags.VOID:
    1.55 +            switch (t.getTag()) {
    1.56 +            case VOID:
    1.57                  return;
    1.58 -            case TypeTags.BYTE:
    1.59 -            case TypeTags.CHAR:
    1.60 -            case TypeTags.SHORT:
    1.61 -            case TypeTags.BOOLEAN:
    1.62 +            case BYTE:
    1.63 +            case CHAR:
    1.64 +            case SHORT:
    1.65 +            case BOOLEAN:
    1.66                  t = syms.intType;
    1.67                  break;
    1.68              default:
    1.69 @@ -1722,7 +1723,7 @@
    1.70           *  of its current type. */
    1.71          void forceStackTop(Type t) {
    1.72              if (!alive) return;
    1.73 -            switch (t.tag) {
    1.74 +            switch (t.getTag()) {
    1.75              case CLASS:
    1.76              case ARRAY:
    1.77                  int width = width(t);
    1.78 @@ -1824,7 +1825,7 @@
    1.79          }
    1.80      }
    1.81  
    1.82 -    static Type jsrReturnValue = new Type(TypeTags.INT, null);
    1.83 +    static Type jsrReturnValue = new Type(INT, null);
    1.84  
    1.85  
    1.86  /* **************************************************************************

mercurial