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

Tue, 09 Sep 2008 10:28:21 -0700

author
jjg
date
Tue, 09 Sep 2008 10:28:21 -0700
changeset 110
91eea580fbe9
parent 86
3437676858e3
child 113
eff38cc97183
permissions
-rw-r--r--

6557752: Original type of an AST should be made available even if it is replaced with an ErrorType
Reviewed-by: mcimadamore

     1 /*
     2  * Copyright 1999-2006 Sun Microsystems, Inc.  All Rights Reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Sun designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Sun in the LICENSE file that accompanied this code.
    10  *
    11  * This code is distributed in the hope that it will be useful, but WITHOUT
    12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    14  * version 2 for more details (a copy is included in the LICENSE file that
    15  * accompanied this code).
    16  *
    17  * You should have received a copy of the GNU General Public License version
    18  * 2 along with this work; if not, write to the Free Software Foundation,
    19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    20  *
    21  * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    22  * CA 95054 USA or visit www.sun.com if you need additional information or
    23  * have any questions.
    24  */
    26 package com.sun.tools.javac.code;
    28 import java.util.*;
    30 import com.sun.tools.javac.util.*;
    31 import com.sun.tools.javac.util.List;
    32 import com.sun.tools.javac.code.Symbol.*;
    33 import com.sun.tools.javac.code.Type.*;
    34 import com.sun.tools.javac.jvm.*;
    36 import static com.sun.tools.javac.jvm.ByteCodes.*;
    37 import static com.sun.tools.javac.code.Flags.*;
    39 /** A class that defines all predefined constants and operators
    40  *  as well as special classes such as java.lang.Object, which need
    41  *  to be known to the compiler. All symbols are held in instance
    42  *  fields. This makes it possible to work in multiple concurrent
    43  *  projects, which might use different class files for library classes.
    44  *
    45  *  <p><b>This is NOT part of any API supported by Sun Microsystems.  If
    46  *  you write code that depends on this, you do so at your own risk.
    47  *  This code and its internal interfaces are subject to change or
    48  *  deletion without notice.</b>
    49  */
    50 public class Symtab {
    51     /** The context key for the symbol table. */
    52     protected static final Context.Key<Symtab> symtabKey =
    53         new Context.Key<Symtab>();
    55     /** Get the symbol table instance. */
    56     public static Symtab instance(Context context) {
    57         Symtab instance = context.get(symtabKey);
    58         if (instance == null)
    59             instance = new Symtab(context);
    60         return instance;
    61     }
    63     /** Builtin types.
    64      */
    65     public final Type byteType = new Type(TypeTags.BYTE, null);
    66     public final Type charType = new Type(TypeTags.CHAR, null);
    67     public final Type shortType = new Type(TypeTags.SHORT, null);
    68     public final Type intType = new Type(TypeTags.INT, null);
    69     public final Type longType = new Type(TypeTags.LONG, null);
    70     public final Type floatType = new Type(TypeTags.FLOAT, null);
    71     public final Type doubleType = new Type(TypeTags.DOUBLE, null);
    72     public final Type booleanType = new Type(TypeTags.BOOLEAN, null);
    73     public final Type botType = new BottomType();
    74     public final JCNoType voidType = new JCNoType(TypeTags.VOID);
    76     private final Name.Table names;
    77     private final ClassReader reader;
    78     private final Target target;
    80     /** A symbol for the root package.
    81      */
    82     public final PackageSymbol rootPackage;
    84     /** A symbol for the unnamed package.
    85      */
    86     public final PackageSymbol unnamedPackage;
    88     /** A symbol that stands for a missing symbol.
    89      */
    90     public final TypeSymbol noSymbol;
    92     /** The error symbol.
    93      */
    94     public final ClassSymbol errSymbol;
    96     /** A value for the errType, with a originalType of noType */
    97     public final Type errType;
    99     /** A value for the unknown type. */
   100     public final Type unknownType;
   102     /** The builtin type of all arrays. */
   103     public final ClassSymbol arrayClass;
   104     public final MethodSymbol arrayCloneMethod;
   106     /** VGJ: The (singleton) type of all bound types. */
   107     public final ClassSymbol boundClass;
   109     /** The builtin type of all methods. */
   110     public final ClassSymbol methodClass;
   112     /** Predefined types.
   113      */
   114     public final Type objectType;
   115     public final Type classType;
   116     public final Type classLoaderType;
   117     public final Type stringType;
   118     public final Type stringBufferType;
   119     public final Type stringBuilderType;
   120     public final Type cloneableType;
   121     public final Type serializableType;
   122     public final Type throwableType;
   123     public final Type errorType;
   124     public final Type illegalArgumentExceptionType;
   125     public final Type exceptionType;
   126     public final Type runtimeExceptionType;
   127     public final Type classNotFoundExceptionType;
   128     public final Type noClassDefFoundErrorType;
   129     public final Type noSuchFieldErrorType;
   130     public final Type assertionErrorType;
   131     public final Type cloneNotSupportedExceptionType;
   132     public final Type annotationType;
   133     public final TypeSymbol enumSym;
   134     public final Type listType;
   135     public final Type collectionsType;
   136     public final Type comparableType;
   137     public final Type arraysType;
   138     public final Type iterableType;
   139     public final Type iteratorType;
   140     public final Type annotationTargetType;
   141     public final Type overrideType;
   142     public final Type retentionType;
   143     public final Type deprecatedType;
   144     public final Type suppressWarningsType;
   145     public final Type inheritedType;
   146     public final Type proprietaryType;
   147     public final Type systemType;
   149     /** The symbol representing the length field of an array.
   150      */
   151     public final VarSymbol lengthVar;
   153     /** The null check operator. */
   154     public final OperatorSymbol nullcheck;
   156     /** The symbol representing the final finalize method on enums */
   157     public final MethodSymbol enumFinalFinalize;
   159     /** The predefined type that belongs to a tag.
   160      */
   161     public final Type[] typeOfTag = new Type[TypeTags.TypeTagCount];
   163     /** The name of the class that belongs to a basix type tag.
   164      */
   165     public final Name[] boxedName = new Name[TypeTags.TypeTagCount];
   167     /** A hashtable containing the encountered top-level and member classes,
   168      *  indexed by flat names. The table does not contain local classes.
   169      *  It should be updated from the outside to reflect classes defined
   170      *  by compiled source files.
   171      */
   172     public final Map<Name, ClassSymbol> classes = new HashMap<Name, ClassSymbol>();
   174     /** A hashtable containing the encountered packages.
   175      *  the table should be updated from outside to reflect packages defined
   176      *  by compiled source files.
   177      */
   178     public final Map<Name, PackageSymbol> packages = new HashMap<Name, PackageSymbol>();
   180     public void initType(Type type, ClassSymbol c) {
   181         type.tsym = c;
   182         typeOfTag[type.tag] = type;
   183     }
   185     public void initType(Type type, String name) {
   186         initType(
   187             type,
   188             new ClassSymbol(
   189                 PUBLIC, names.fromString(name), type, rootPackage));
   190     }
   192     public void initType(Type type, String name, String bname) {
   193         initType(type, name);
   194         boxedName[type.tag] = names.fromString("java.lang." + bname);
   195     }
   197     /** The class symbol that owns all predefined symbols.
   198      */
   199     public final ClassSymbol predefClass;
   201     /** Enter a constant into symbol table.
   202      *  @param name   The constant's name.
   203      *  @param type   The constant's type.
   204      */
   205     private VarSymbol enterConstant(String name, Type type) {
   206         VarSymbol c = new VarSymbol(
   207             PUBLIC | STATIC | FINAL,
   208             names.fromString(name),
   209             type,
   210             predefClass);
   211         c.setData(type.constValue());
   212         predefClass.members().enter(c);
   213         return c;
   214     }
   216     /** Enter a binary operation into symbol table.
   217      *  @param name     The name of the operator.
   218      *  @param left     The type of the left operand.
   219      *  @param right    The type of the left operand.
   220      *  @param res      The operation's result type.
   221      *  @param opcode   The operation's bytecode instruction.
   222      */
   223     private void enterBinop(String name,
   224                             Type left, Type right, Type res,
   225                             int opcode) {
   226         predefClass.members().enter(
   227             new OperatorSymbol(
   228                 names.fromString(name),
   229                 new MethodType(List.of(left, right), res,
   230                                List.<Type>nil(), methodClass),
   231                 opcode,
   232                 predefClass));
   233     }
   235     /** Enter a binary operation, as above but with two opcodes,
   236      *  which get encoded as (opcode1 << ByteCodeTags.preShift) + opcode2.
   237      *  @param opcode1     First opcode.
   238      *  @param opcode2     Second opcode.
   239      */
   240     private void enterBinop(String name,
   241                             Type left, Type right, Type res,
   242                             int opcode1, int opcode2) {
   243         enterBinop(
   244             name, left, right, res, (opcode1 << ByteCodes.preShift) | opcode2);
   245     }
   247     /** Enter a unary operation into symbol table.
   248      *  @param name     The name of the operator.
   249      *  @param arg      The type of the operand.
   250      *  @param res      The operation's result type.
   251      *  @param opcode   The operation's bytecode instruction.
   252      */
   253     private OperatorSymbol enterUnop(String name,
   254                                      Type arg,
   255                                      Type res,
   256                                      int opcode) {
   257         OperatorSymbol sym =
   258             new OperatorSymbol(names.fromString(name),
   259                                new MethodType(List.of(arg),
   260                                               res,
   261                                               List.<Type>nil(),
   262                                               methodClass),
   263                                opcode,
   264                                predefClass);
   265         predefClass.members().enter(sym);
   266         return sym;
   267     }
   269     /** Enter a class into symbol table.
   270      *  @param    The name of the class.
   271      */
   272     private Type enterClass(String s) {
   273         return reader.enterClass(names.fromString(s)).type;
   274     }
   276     public void synthesizeEmptyInterfaceIfMissing(final Type type) {
   277         final Completer completer = type.tsym.completer;
   278         if (completer != null) {
   279             type.tsym.completer = new Completer() {
   280                 public void complete(Symbol sym) throws CompletionFailure {
   281                     try {
   282                         completer.complete(sym);
   283                     } catch (CompletionFailure e) {
   284                         sym.flags_field |= (PUBLIC | INTERFACE);
   285                         ((ClassType) sym.type).supertype_field = objectType;
   286                     }
   287                 }
   288             };
   289         }
   290     }
   292     public void synthesizeBoxTypeIfMissing(final Type type) {
   293         ClassSymbol sym = reader.enterClass(boxedName[type.tag]);
   294         final Completer completer = sym.completer;
   295         if (completer != null) {
   296             sym.completer = new Completer() {
   297                 public void complete(Symbol sym) throws CompletionFailure {
   298                     try {
   299                         completer.complete(sym);
   300                     } catch (CompletionFailure e) {
   301                         sym.flags_field |= PUBLIC;
   302                         ((ClassType) sym.type).supertype_field = objectType;
   303                         Name n = target.boxWithConstructors() ? names.init : names.valueOf;
   304                         MethodSymbol boxMethod =
   305                             new MethodSymbol(PUBLIC | STATIC,
   306                                 n,
   307                                 new MethodType(List.of(type), sym.type,
   308                                     List.<Type>nil(), methodClass),
   309                                 sym);
   310                         sym.members().enter(boxMethod);
   311                         MethodSymbol unboxMethod =
   312                             new MethodSymbol(PUBLIC,
   313                                 type.tsym.name.append(names.Value), // x.intValue()
   314                                 new MethodType(List.<Type>nil(), type,
   315                                     List.<Type>nil(), methodClass),
   316                                 sym);
   317                         sym.members().enter(unboxMethod);
   318                     }
   319                 }
   320             };
   321         }
   323     }
   325     /** Constructor; enters all predefined identifiers and operators
   326      *  into symbol table.
   327      */
   328     protected Symtab(Context context) throws CompletionFailure {
   329         context.put(symtabKey, this);
   331         names = Name.Table.instance(context);
   332         target = Target.instance(context);
   334         // Create the unknown type
   335         unknownType = new Type(TypeTags.UNKNOWN, null);
   337         // create the basic builtin symbols
   338         rootPackage = new PackageSymbol(names.empty, null);
   339         final Messages messages = Messages.instance(context);
   340         unnamedPackage = new PackageSymbol(names.empty, rootPackage) {
   341                 public String toString() {
   342                     return messages.getLocalizedString("compiler.misc.unnamed.package");
   343                 }
   344             };
   345         noSymbol = new TypeSymbol(0, names.empty, Type.noType, rootPackage);
   346         noSymbol.kind = Kinds.NIL;
   348         // create the error symbols
   349         errSymbol = new ClassSymbol(PUBLIC|STATIC|ACYCLIC, names.any, null, rootPackage);
   350         errType = new ErrorType(errSymbol, Type.noType);
   352         // initialize builtin types
   353         initType(byteType, "byte", "Byte");
   354         initType(shortType, "short", "Short");
   355         initType(charType, "char", "Character");
   356         initType(intType, "int", "Integer");
   357         initType(longType, "long", "Long");
   358         initType(floatType, "float", "Float");
   359         initType(doubleType, "double", "Double");
   360         initType(booleanType, "boolean", "Boolean");
   361         initType(voidType, "void", "Void");
   362         initType(botType, "<nulltype>");
   363         initType(errType, errSymbol);
   364         initType(unknownType, "<any?>");
   366         // the builtin class of all arrays
   367         arrayClass = new ClassSymbol(PUBLIC|ACYCLIC, names.Array, noSymbol);
   369         // VGJ
   370         boundClass = new ClassSymbol(PUBLIC|ACYCLIC, names.Bound, noSymbol);
   372         // the builtin class of all methods
   373         methodClass = new ClassSymbol(PUBLIC|ACYCLIC, names.Method, noSymbol);
   375         // Create class to hold all predefined constants and operations.
   376         predefClass = new ClassSymbol(PUBLIC|ACYCLIC, names.empty, rootPackage);
   377         Scope scope = new Scope(predefClass);
   378         predefClass.members_field = scope;
   380         // Enter symbols for basic types.
   381         scope.enter(byteType.tsym);
   382         scope.enter(shortType.tsym);
   383         scope.enter(charType.tsym);
   384         scope.enter(intType.tsym);
   385         scope.enter(longType.tsym);
   386         scope.enter(floatType.tsym);
   387         scope.enter(doubleType.tsym);
   388         scope.enter(booleanType.tsym);
   389         scope.enter(errType.tsym);
   391         // Enter symbol for the errSymbol
   392         scope.enter(errSymbol);
   394         classes.put(predefClass.fullname, predefClass);
   396         reader = ClassReader.instance(context);
   397         reader.init(this);
   399         // Enter predefined classes.
   400         objectType = enterClass("java.lang.Object");
   401         classType = enterClass("java.lang.Class");
   402         stringType = enterClass("java.lang.String");
   403         stringBufferType = enterClass("java.lang.StringBuffer");
   404         stringBuilderType = enterClass("java.lang.StringBuilder");
   405         cloneableType = enterClass("java.lang.Cloneable");
   406         throwableType = enterClass("java.lang.Throwable");
   407         serializableType = enterClass("java.io.Serializable");
   408         errorType = enterClass("java.lang.Error");
   409         illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
   410         exceptionType = enterClass("java.lang.Exception");
   411         runtimeExceptionType = enterClass("java.lang.RuntimeException");
   412         classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException");
   413         noClassDefFoundErrorType = enterClass("java.lang.NoClassDefFoundError");
   414         noSuchFieldErrorType = enterClass("java.lang.NoSuchFieldError");
   415         assertionErrorType = enterClass("java.lang.AssertionError");
   416         cloneNotSupportedExceptionType = enterClass("java.lang.CloneNotSupportedException");
   417         annotationType = enterClass("java.lang.annotation.Annotation");
   418         classLoaderType = enterClass("java.lang.ClassLoader");
   419         enumSym = reader.enterClass(names.java_lang_Enum);
   420         enumFinalFinalize =
   421             new MethodSymbol(PROTECTED|FINAL|HYPOTHETICAL,
   422                              names.finalize,
   423                              new MethodType(List.<Type>nil(), voidType,
   424                                             List.<Type>nil(), methodClass),
   425                              enumSym);
   426         listType = enterClass("java.util.List");
   427         collectionsType = enterClass("java.util.Collections");
   428         comparableType = enterClass("java.lang.Comparable");
   429         arraysType = enterClass("java.util.Arrays");
   430         iterableType = target.hasIterable()
   431             ? enterClass("java.lang.Iterable")
   432             : enterClass("java.util.Collection");
   433         iteratorType = enterClass("java.util.Iterator");
   434         annotationTargetType = enterClass("java.lang.annotation.Target");
   435         overrideType = enterClass("java.lang.Override");
   436         retentionType = enterClass("java.lang.annotation.Retention");
   437         deprecatedType = enterClass("java.lang.Deprecated");
   438         suppressWarningsType = enterClass("java.lang.SuppressWarnings");
   439         inheritedType = enterClass("java.lang.annotation.Inherited");
   440         systemType = enterClass("java.lang.System");
   442         synthesizeEmptyInterfaceIfMissing(cloneableType);
   443         synthesizeEmptyInterfaceIfMissing(serializableType);
   444         synthesizeBoxTypeIfMissing(doubleType);
   445         synthesizeBoxTypeIfMissing(floatType);
   447         // Enter a synthetic class that is used to mark Sun
   448         // proprietary classes in ct.sym.  This class does not have a
   449         // class file.
   450         ClassType proprietaryType = (ClassType)enterClass("sun.Proprietary+Annotation");
   451         this.proprietaryType = proprietaryType;
   452         ClassSymbol proprietarySymbol = (ClassSymbol)proprietaryType.tsym;
   453         proprietarySymbol.completer = null;
   454         proprietarySymbol.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
   455         proprietarySymbol.erasure_field = proprietaryType;
   456         proprietarySymbol.members_field = new Scope(proprietarySymbol);
   457         proprietaryType.typarams_field = List.nil();
   458         proprietaryType.allparams_field = List.nil();
   459         proprietaryType.supertype_field = annotationType;
   460         proprietaryType.interfaces_field = List.nil();
   462         // Enter a class for arrays.
   463         // The class implements java.lang.Cloneable and java.io.Serializable.
   464         // It has a final length field and a clone method.
   465         ClassType arrayClassType = (ClassType)arrayClass.type;
   466         arrayClassType.supertype_field = objectType;
   467         arrayClassType.interfaces_field = List.of(cloneableType, serializableType);
   468         arrayClass.members_field = new Scope(arrayClass);
   469         lengthVar = new VarSymbol(
   470             PUBLIC | FINAL,
   471             names.length,
   472             intType,
   473             arrayClass);
   474         arrayClass.members().enter(lengthVar);
   475         arrayCloneMethod = new MethodSymbol(
   476             PUBLIC,
   477             names.clone,
   478             new MethodType(List.<Type>nil(), objectType,
   479                            List.<Type>nil(), methodClass),
   480             arrayClass);
   481         arrayClass.members().enter(arrayCloneMethod);
   483         // Enter operators.
   484         enterUnop("+", doubleType, doubleType, nop);
   485         enterUnop("+", floatType, floatType, nop);
   486         enterUnop("+", longType, longType, nop);
   487         enterUnop("+", intType, intType, nop);
   489         enterUnop("-", doubleType, doubleType, dneg);
   490         enterUnop("-", floatType, floatType, fneg);
   491         enterUnop("-", longType, longType, lneg);
   492         enterUnop("-", intType, intType, ineg);
   494         enterUnop("~", longType, longType, lxor);
   495         enterUnop("~", intType, intType, ixor);
   497         enterUnop("++", doubleType, doubleType, dadd);
   498         enterUnop("++", floatType, floatType, fadd);
   499         enterUnop("++", longType, longType, ladd);
   500         enterUnop("++", intType, intType, iadd);
   501         enterUnop("++", charType, charType, iadd);
   502         enterUnop("++", shortType, shortType, iadd);
   503         enterUnop("++", byteType, byteType, iadd);
   505         enterUnop("--", doubleType, doubleType, dsub);
   506         enterUnop("--", floatType, floatType, fsub);
   507         enterUnop("--", longType, longType, lsub);
   508         enterUnop("--", intType, intType, isub);
   509         enterUnop("--", charType, charType, isub);
   510         enterUnop("--", shortType, shortType, isub);
   511         enterUnop("--", byteType, byteType, isub);
   513         enterUnop("!", booleanType, booleanType, bool_not);
   514         nullcheck = enterUnop("<*nullchk*>", objectType, objectType, nullchk);
   516         // string concatenation
   517         enterBinop("+", stringType, objectType, stringType, string_add);
   518         enterBinop("+", objectType, stringType, stringType, string_add);
   519         enterBinop("+", stringType, stringType, stringType, string_add);
   520         enterBinop("+", stringType, intType, stringType, string_add);
   521         enterBinop("+", stringType, longType, stringType, string_add);
   522         enterBinop("+", stringType, floatType, stringType, string_add);
   523         enterBinop("+", stringType, doubleType, stringType, string_add);
   524         enterBinop("+", stringType, booleanType, stringType, string_add);
   525         enterBinop("+", stringType, botType, stringType, string_add);
   526         enterBinop("+", intType, stringType, stringType, string_add);
   527         enterBinop("+", longType, stringType, stringType, string_add);
   528         enterBinop("+", floatType, stringType, stringType, string_add);
   529         enterBinop("+", doubleType, stringType, stringType, string_add);
   530         enterBinop("+", booleanType, stringType, stringType, string_add);
   531         enterBinop("+", botType, stringType, stringType, string_add);
   533         // these errors would otherwise be matched as string concatenation
   534         enterBinop("+", botType, botType, botType, error);
   535         enterBinop("+", botType, intType, botType, error);
   536         enterBinop("+", botType, longType, botType, error);
   537         enterBinop("+", botType, floatType, botType, error);
   538         enterBinop("+", botType, doubleType, botType, error);
   539         enterBinop("+", botType, booleanType, botType, error);
   540         enterBinop("+", botType, objectType, botType, error);
   541         enterBinop("+", intType, botType, botType, error);
   542         enterBinop("+", longType, botType, botType, error);
   543         enterBinop("+", floatType, botType, botType, error);
   544         enterBinop("+", doubleType, botType, botType, error);
   545         enterBinop("+", booleanType, botType, botType, error);
   546         enterBinop("+", objectType, botType, botType, error);
   548         enterBinop("+", doubleType, doubleType, doubleType, dadd);
   549         enterBinop("+", floatType, floatType, floatType, fadd);
   550         enterBinop("+", longType, longType, longType, ladd);
   551         enterBinop("+", intType, intType, intType, iadd);
   553         enterBinop("-", doubleType, doubleType, doubleType, dsub);
   554         enterBinop("-", floatType, floatType, floatType, fsub);
   555         enterBinop("-", longType, longType, longType, lsub);
   556         enterBinop("-", intType, intType, intType, isub);
   558         enterBinop("*", doubleType, doubleType, doubleType, dmul);
   559         enterBinop("*", floatType, floatType, floatType, fmul);
   560         enterBinop("*", longType, longType, longType, lmul);
   561         enterBinop("*", intType, intType, intType, imul);
   563         enterBinop("/", doubleType, doubleType, doubleType, ddiv);
   564         enterBinop("/", floatType, floatType, floatType, fdiv);
   565         enterBinop("/", longType, longType, longType, ldiv);
   566         enterBinop("/", intType, intType, intType, idiv);
   568         enterBinop("%", doubleType, doubleType, doubleType, dmod);
   569         enterBinop("%", floatType, floatType, floatType, fmod);
   570         enterBinop("%", longType, longType, longType, lmod);
   571         enterBinop("%", intType, intType, intType, imod);
   573         enterBinop("&", booleanType, booleanType, booleanType, iand);
   574         enterBinop("&", longType, longType, longType, land);
   575         enterBinop("&", intType, intType, intType, iand);
   577         enterBinop("|", booleanType, booleanType, booleanType, ior);
   578         enterBinop("|", longType, longType, longType, lor);
   579         enterBinop("|", intType, intType, intType, ior);
   581         enterBinop("^", booleanType, booleanType, booleanType, ixor);
   582         enterBinop("^", longType, longType, longType, lxor);
   583         enterBinop("^", intType, intType, intType, ixor);
   585         enterBinop("<<", longType, longType, longType, lshll);
   586         enterBinop("<<", intType, longType, intType, ishll);
   587         enterBinop("<<", longType, intType, longType, lshl);
   588         enterBinop("<<", intType, intType, intType, ishl);
   590         enterBinop(">>", longType, longType, longType, lshrl);
   591         enterBinop(">>", intType, longType, intType, ishrl);
   592         enterBinop(">>", longType, intType, longType, lshr);
   593         enterBinop(">>", intType, intType, intType, ishr);
   595         enterBinop(">>>", longType, longType, longType, lushrl);
   596         enterBinop(">>>", intType, longType, intType, iushrl);
   597         enterBinop(">>>", longType, intType, longType, lushr);
   598         enterBinop(">>>", intType, intType, intType, iushr);
   600         enterBinop("<", doubleType, doubleType, booleanType, dcmpg, iflt);
   601         enterBinop("<", floatType, floatType, booleanType, fcmpg, iflt);
   602         enterBinop("<", longType, longType, booleanType, lcmp, iflt);
   603         enterBinop("<", intType, intType, booleanType, if_icmplt);
   605         enterBinop(">", doubleType, doubleType, booleanType, dcmpl, ifgt);
   606         enterBinop(">", floatType, floatType, booleanType, fcmpl, ifgt);
   607         enterBinop(">", longType, longType, booleanType, lcmp, ifgt);
   608         enterBinop(">", intType, intType, booleanType, if_icmpgt);
   610         enterBinop("<=", doubleType, doubleType, booleanType, dcmpg, ifle);
   611         enterBinop("<=", floatType, floatType, booleanType, fcmpg, ifle);
   612         enterBinop("<=", longType, longType, booleanType, lcmp, ifle);
   613         enterBinop("<=", intType, intType, booleanType, if_icmple);
   615         enterBinop(">=", doubleType, doubleType, booleanType, dcmpl, ifge);
   616         enterBinop(">=", floatType, floatType, booleanType, fcmpl, ifge);
   617         enterBinop(">=", longType, longType, booleanType, lcmp, ifge);
   618         enterBinop(">=", intType, intType, booleanType, if_icmpge);
   620         enterBinop("==", objectType, objectType, booleanType, if_acmpeq);
   621         enterBinop("==", booleanType, booleanType, booleanType, if_icmpeq);
   622         enterBinop("==", doubleType, doubleType, booleanType, dcmpl, ifeq);
   623         enterBinop("==", floatType, floatType, booleanType, fcmpl, ifeq);
   624         enterBinop("==", longType, longType, booleanType, lcmp, ifeq);
   625         enterBinop("==", intType, intType, booleanType, if_icmpeq);
   627         enterBinop("!=", objectType, objectType, booleanType, if_acmpne);
   628         enterBinop("!=", booleanType, booleanType, booleanType, if_icmpne);
   629         enterBinop("!=", doubleType, doubleType, booleanType, dcmpl, ifne);
   630         enterBinop("!=", floatType, floatType, booleanType, fcmpl, ifne);
   631         enterBinop("!=", longType, longType, booleanType, lcmp, ifne);
   632         enterBinop("!=", intType, intType, booleanType, if_icmpne);
   634         enterBinop("&&", booleanType, booleanType, booleanType, bool_and);
   635         enterBinop("||", booleanType, booleanType, booleanType, bool_or);
   636     }
   637 }

mercurial