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

Mon, 28 Feb 2011 13:42:24 -0800

author
jjg
date
Mon, 28 Feb 2011 13:42:24 -0800
changeset 899
67d6b2df47ba
parent 858
96d4226bdd60
child 900
938dda0bec17
permissions
-rw-r--r--

7022711: compiler crash in try-with-resources
Reviewed-by: mcimadamore

     1 /*
     2  * Copyright (c) 1999, 2010, Oracle and/or its affiliates. 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.  Oracle designates this
     8  * particular file as subject to the "Classpath" exception as provided
     9  * by Oracle 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 Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    22  * or visit www.oracle.com if you need additional information or have any
    23  * 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 supported API.
    46  *  If 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 Names 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     /** The unknown symbol.
    97      */
    98     public final ClassSymbol unknownSymbol;
   100     /** A value for the errType, with a originalType of noType */
   101     public final Type errType;
   103     /** A value for the unknown type. */
   104     public final Type unknownType;
   106     /** The builtin type of all arrays. */
   107     public final ClassSymbol arrayClass;
   108     public final MethodSymbol arrayCloneMethod;
   110     /** VGJ: The (singleton) type of all bound types. */
   111     public final ClassSymbol boundClass;
   113     /** The builtin type of all methods. */
   114     public final ClassSymbol methodClass;
   116     /** Predefined types.
   117      */
   118     public final Type objectType;
   119     public final Type classType;
   120     public final Type classLoaderType;
   121     public final Type stringType;
   122     public final Type stringBufferType;
   123     public final Type stringBuilderType;
   124     public final Type cloneableType;
   125     public final Type serializableType;
   126     public final Type transientMethodHandleType; // transient - 292
   127     public final Type methodHandleType;
   128     public final Type transientPolymorphicSignatureType; // transient - 292
   129     public final Type polymorphicSignatureType;
   130     public final Type throwableType;
   131     public final Type errorType;
   132     public final Type illegalArgumentExceptionType;
   133     public final Type exceptionType;
   134     public final Type runtimeExceptionType;
   135     public final Type classNotFoundExceptionType;
   136     public final Type noClassDefFoundErrorType;
   137     public final Type noSuchFieldErrorType;
   138     public final Type assertionErrorType;
   139     public final Type cloneNotSupportedExceptionType;
   140     public final Type annotationType;
   141     public final TypeSymbol enumSym;
   142     public final Type listType;
   143     public final Type collectionsType;
   144     public final Type comparableType;
   145     public final Type arraysType;
   146     public final Type iterableType;
   147     public final Type iteratorType;
   148     public final Type annotationTargetType;
   149     public final Type overrideType;
   150     public final Type retentionType;
   151     public final Type deprecatedType;
   152     public final Type suppressWarningsType;
   153     public final Type inheritedType;
   154     public final Type proprietaryType;
   155     public final Type systemType;
   156     public final Type autoCloseableType;
   157     public final Type trustMeType;
   159     /** The symbol representing the length field of an array.
   160      */
   161     public final VarSymbol lengthVar;
   163     /** The null check operator. */
   164     public final OperatorSymbol nullcheck;
   166     /** The symbol representing the final finalize method on enums */
   167     public final MethodSymbol enumFinalFinalize;
   169     /** The symbol representing the close method on TWR AutoCloseable type */
   170     public final MethodSymbol autoCloseableClose;
   172     /** The predefined type that belongs to a tag.
   173      */
   174     public final Type[] typeOfTag = new Type[TypeTags.TypeTagCount];
   176     /** The name of the class that belongs to a basix type tag.
   177      */
   178     public final Name[] boxedName = new Name[TypeTags.TypeTagCount];
   180     /** A hashtable containing the encountered top-level and member classes,
   181      *  indexed by flat names. The table does not contain local classes.
   182      *  It should be updated from the outside to reflect classes defined
   183      *  by compiled source files.
   184      */
   185     public final Map<Name, ClassSymbol> classes = new HashMap<Name, ClassSymbol>();
   187     /** A hashtable containing the encountered packages.
   188      *  the table should be updated from outside to reflect packages defined
   189      *  by compiled source files.
   190      */
   191     public final Map<Name, PackageSymbol> packages = new HashMap<Name, PackageSymbol>();
   193     public void initType(Type type, ClassSymbol c) {
   194         type.tsym = c;
   195         typeOfTag[type.tag] = type;
   196     }
   198     public void initType(Type type, String name) {
   199         initType(
   200             type,
   201             new ClassSymbol(
   202                 PUBLIC, names.fromString(name), type, rootPackage));
   203     }
   205     public void initType(Type type, String name, String bname) {
   206         initType(type, name);
   207             boxedName[type.tag] = names.fromString("java.lang." + bname);
   208     }
   210     /** The class symbol that owns all predefined symbols.
   211      */
   212     public final ClassSymbol predefClass;
   214     /** Enter a constant into symbol table.
   215      *  @param name   The constant's name.
   216      *  @param type   The constant's type.
   217      */
   218     private VarSymbol enterConstant(String name, Type type) {
   219         VarSymbol c = new VarSymbol(
   220             PUBLIC | STATIC | FINAL,
   221             names.fromString(name),
   222             type,
   223             predefClass);
   224         c.setData(type.constValue());
   225         predefClass.members().enter(c);
   226         return c;
   227     }
   229     /** Enter a binary operation into symbol table.
   230      *  @param name     The name of the operator.
   231      *  @param left     The type of the left operand.
   232      *  @param right    The type of the left operand.
   233      *  @param res      The operation's result type.
   234      *  @param opcode   The operation's bytecode instruction.
   235      */
   236     private void enterBinop(String name,
   237                             Type left, Type right, Type res,
   238                             int opcode) {
   239         predefClass.members().enter(
   240             new OperatorSymbol(
   241                 names.fromString(name),
   242                 new MethodType(List.of(left, right), res,
   243                                List.<Type>nil(), methodClass),
   244                 opcode,
   245                 predefClass));
   246     }
   248     /** Enter a binary operation, as above but with two opcodes,
   249      *  which get encoded as (opcode1 << ByteCodeTags.preShift) + opcode2.
   250      *  @param opcode1     First opcode.
   251      *  @param opcode2     Second opcode.
   252      */
   253     private void enterBinop(String name,
   254                             Type left, Type right, Type res,
   255                             int opcode1, int opcode2) {
   256         enterBinop(
   257             name, left, right, res, (opcode1 << ByteCodes.preShift) | opcode2);
   258     }
   260     /** Enter a unary operation into symbol table.
   261      *  @param name     The name of the operator.
   262      *  @param arg      The type of the operand.
   263      *  @param res      The operation's result type.
   264      *  @param opcode   The operation's bytecode instruction.
   265      */
   266     private OperatorSymbol enterUnop(String name,
   267                                      Type arg,
   268                                      Type res,
   269                                      int opcode) {
   270         OperatorSymbol sym =
   271             new OperatorSymbol(names.fromString(name),
   272                                new MethodType(List.of(arg),
   273                                               res,
   274                                               List.<Type>nil(),
   275                                               methodClass),
   276                                opcode,
   277                                predefClass);
   278         predefClass.members().enter(sym);
   279         return sym;
   280     }
   282     /** Enter a class into symbol table.
   283      *  @param    The name of the class.
   284      */
   285     private Type enterClass(String s) {
   286         return reader.enterClass(names.fromString(s)).type;
   287     }
   289     public void synthesizeEmptyInterfaceIfMissing(final Type type) {
   290         final Completer completer = type.tsym.completer;
   291         if (completer != null) {
   292             type.tsym.completer = new Completer() {
   293                 public void complete(Symbol sym) throws CompletionFailure {
   294                     try {
   295                         completer.complete(sym);
   296                     } catch (CompletionFailure e) {
   297                         sym.flags_field |= (PUBLIC | INTERFACE);
   298                         ((ClassType) sym.type).supertype_field = objectType;
   299                     }
   300                 }
   301             };
   302         }
   303     }
   305     public void synthesizeBoxTypeIfMissing(final Type type) {
   306         ClassSymbol sym = reader.enterClass(boxedName[type.tag]);
   307         final Completer completer = sym.completer;
   308         if (completer != null) {
   309             sym.completer = new Completer() {
   310                 public void complete(Symbol sym) throws CompletionFailure {
   311                     try {
   312                         completer.complete(sym);
   313                     } catch (CompletionFailure e) {
   314                         sym.flags_field |= PUBLIC;
   315                         ((ClassType) sym.type).supertype_field = objectType;
   316                         Name n = target.boxWithConstructors() ? names.init : names.valueOf;
   317                         MethodSymbol boxMethod =
   318                             new MethodSymbol(PUBLIC | STATIC,
   319                                 n,
   320                                 new MethodType(List.of(type), sym.type,
   321                                     List.<Type>nil(), methodClass),
   322                                 sym);
   323                         sym.members().enter(boxMethod);
   324                         MethodSymbol unboxMethod =
   325                             new MethodSymbol(PUBLIC,
   326                                 type.tsym.name.append(names.Value), // x.intValue()
   327                                 new MethodType(List.<Type>nil(), type,
   328                                     List.<Type>nil(), methodClass),
   329                                 sym);
   330                         sym.members().enter(unboxMethod);
   331                     }
   332                 }
   333             };
   334         }
   336     }
   338     /** Constructor; enters all predefined identifiers and operators
   339      *  into symbol table.
   340      */
   341     protected Symtab(Context context) throws CompletionFailure {
   342         context.put(symtabKey, this);
   344         names = Names.instance(context);
   345         target = Target.instance(context);
   347         // Create the unknown type
   348         unknownType = new Type(TypeTags.UNKNOWN, null);
   350         // create the basic builtin symbols
   351         rootPackage = new PackageSymbol(names.empty, null);
   352         final JavacMessages messages = JavacMessages.instance(context);
   353         unnamedPackage = new PackageSymbol(names.empty, rootPackage) {
   354                 public String toString() {
   355                     return messages.getLocalizedString("compiler.misc.unnamed.package");
   356                 }
   357             };
   358         noSymbol = new TypeSymbol(0, names.empty, Type.noType, rootPackage);
   359         noSymbol.kind = Kinds.NIL;
   361         // create the error symbols
   362         errSymbol = new ClassSymbol(PUBLIC|STATIC|ACYCLIC, names.any, null, rootPackage);
   363         unknownSymbol = new ClassSymbol(PUBLIC|STATIC|ACYCLIC, names.fromString("<any?>"), null, rootPackage);
   364         errType = new ErrorType(errSymbol, Type.noType);
   366         // initialize builtin types
   367         initType(byteType, "byte", "Byte");
   368         initType(shortType, "short", "Short");
   369         initType(charType, "char", "Character");
   370         initType(intType, "int", "Integer");
   371         initType(longType, "long", "Long");
   372         initType(floatType, "float", "Float");
   373         initType(doubleType, "double", "Double");
   374         initType(booleanType, "boolean", "Boolean");
   375         initType(voidType, "void", "Void");
   376         initType(botType, "<nulltype>");
   377         initType(errType, errSymbol);
   378         initType(unknownType, unknownSymbol);
   380         // the builtin class of all arrays
   381         arrayClass = new ClassSymbol(PUBLIC|ACYCLIC, names.Array, noSymbol);
   383         // VGJ
   384         boundClass = new ClassSymbol(PUBLIC|ACYCLIC, names.Bound, noSymbol);
   386         // the builtin class of all methods
   387         methodClass = new ClassSymbol(PUBLIC|ACYCLIC, names.Method, noSymbol);
   389         // Create class to hold all predefined constants and operations.
   390         predefClass = new ClassSymbol(PUBLIC|ACYCLIC, names.empty, rootPackage);
   391         Scope scope = new Scope(predefClass);
   392         predefClass.members_field = scope;
   394         // Enter symbols for basic types.
   395         scope.enter(byteType.tsym);
   396         scope.enter(shortType.tsym);
   397         scope.enter(charType.tsym);
   398         scope.enter(intType.tsym);
   399         scope.enter(longType.tsym);
   400         scope.enter(floatType.tsym);
   401         scope.enter(doubleType.tsym);
   402         scope.enter(booleanType.tsym);
   403         scope.enter(errType.tsym);
   405         // Enter symbol for the errSymbol
   406         scope.enter(errSymbol);
   408         classes.put(predefClass.fullname, predefClass);
   410         reader = ClassReader.instance(context);
   411         reader.init(this);
   413         // Enter predefined classes.
   414         objectType = enterClass("java.lang.Object");
   415         classType = enterClass("java.lang.Class");
   416         stringType = enterClass("java.lang.String");
   417         stringBufferType = enterClass("java.lang.StringBuffer");
   418         stringBuilderType = enterClass("java.lang.StringBuilder");
   419         cloneableType = enterClass("java.lang.Cloneable");
   420         throwableType = enterClass("java.lang.Throwable");
   421         serializableType = enterClass("java.io.Serializable");
   422         transientMethodHandleType = enterClass("java.dyn.MethodHandle"); // transient - 292
   423         methodHandleType = enterClass("java.lang.invoke.MethodHandle");
   424         transientPolymorphicSignatureType = enterClass("java.dyn.MethodHandle$PolymorphicSignature"); // transient - 292
   425         polymorphicSignatureType = enterClass("java.lang.invoke.MethodHandle$PolymorphicSignature");
   426         errorType = enterClass("java.lang.Error");
   427         illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
   428         exceptionType = enterClass("java.lang.Exception");
   429         runtimeExceptionType = enterClass("java.lang.RuntimeException");
   430         classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException");
   431         noClassDefFoundErrorType = enterClass("java.lang.NoClassDefFoundError");
   432         noSuchFieldErrorType = enterClass("java.lang.NoSuchFieldError");
   433         assertionErrorType = enterClass("java.lang.AssertionError");
   434         cloneNotSupportedExceptionType = enterClass("java.lang.CloneNotSupportedException");
   435         annotationType = enterClass("java.lang.annotation.Annotation");
   436         classLoaderType = enterClass("java.lang.ClassLoader");
   437         enumSym = reader.enterClass(names.java_lang_Enum);
   438         enumFinalFinalize =
   439             new MethodSymbol(PROTECTED|FINAL|HYPOTHETICAL,
   440                              names.finalize,
   441                              new MethodType(List.<Type>nil(), voidType,
   442                                             List.<Type>nil(), methodClass),
   443                              enumSym);
   444         listType = enterClass("java.util.List");
   445         collectionsType = enterClass("java.util.Collections");
   446         comparableType = enterClass("java.lang.Comparable");
   447         arraysType = enterClass("java.util.Arrays");
   448         iterableType = target.hasIterable()
   449             ? enterClass("java.lang.Iterable")
   450             : enterClass("java.util.Collection");
   451         iteratorType = enterClass("java.util.Iterator");
   452         annotationTargetType = enterClass("java.lang.annotation.Target");
   453         overrideType = enterClass("java.lang.Override");
   454         retentionType = enterClass("java.lang.annotation.Retention");
   455         deprecatedType = enterClass("java.lang.Deprecated");
   456         suppressWarningsType = enterClass("java.lang.SuppressWarnings");
   457         inheritedType = enterClass("java.lang.annotation.Inherited");
   458         systemType = enterClass("java.lang.System");
   459         autoCloseableType = enterClass("java.lang.AutoCloseable");
   460         autoCloseableClose = new MethodSymbol(PUBLIC,
   461                              names.close,
   462                              new MethodType(List.<Type>nil(), voidType,
   463                                             List.of(exceptionType), methodClass),
   464                              autoCloseableType.tsym);
   465         trustMeType = enterClass("java.lang.SafeVarargs");
   467         synthesizeEmptyInterfaceIfMissing(cloneableType);
   468         synthesizeEmptyInterfaceIfMissing(serializableType);
   469         synthesizeEmptyInterfaceIfMissing(transientPolymorphicSignatureType); // transient - 292
   470         synthesizeEmptyInterfaceIfMissing(polymorphicSignatureType);
   471         synthesizeBoxTypeIfMissing(doubleType);
   472         synthesizeBoxTypeIfMissing(floatType);
   473         synthesizeBoxTypeIfMissing(voidType);
   475         // Enter a synthetic class that is used to mark internal
   476         // proprietary classes in ct.sym.  This class does not have a
   477         // class file.
   478         ClassType proprietaryType = (ClassType)enterClass("sun.Proprietary+Annotation");
   479         this.proprietaryType = proprietaryType;
   480         ClassSymbol proprietarySymbol = (ClassSymbol)proprietaryType.tsym;
   481         proprietarySymbol.completer = null;
   482         proprietarySymbol.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
   483         proprietarySymbol.erasure_field = proprietaryType;
   484         proprietarySymbol.members_field = new Scope(proprietarySymbol);
   485         proprietaryType.typarams_field = List.nil();
   486         proprietaryType.allparams_field = List.nil();
   487         proprietaryType.supertype_field = annotationType;
   488         proprietaryType.interfaces_field = List.nil();
   490         // Enter a class for arrays.
   491         // The class implements java.lang.Cloneable and java.io.Serializable.
   492         // It has a final length field and a clone method.
   493         ClassType arrayClassType = (ClassType)arrayClass.type;
   494         arrayClassType.supertype_field = objectType;
   495         arrayClassType.interfaces_field = List.of(cloneableType, serializableType);
   496         arrayClass.members_field = new Scope(arrayClass);
   497         lengthVar = new VarSymbol(
   498             PUBLIC | FINAL,
   499             names.length,
   500             intType,
   501             arrayClass);
   502         arrayClass.members().enter(lengthVar);
   503         arrayCloneMethod = new MethodSymbol(
   504             PUBLIC,
   505             names.clone,
   506             new MethodType(List.<Type>nil(), objectType,
   507                            List.<Type>nil(), methodClass),
   508             arrayClass);
   509         arrayClass.members().enter(arrayCloneMethod);
   511         // Enter operators.
   512         enterUnop("+", doubleType, doubleType, nop);
   513         enterUnop("+", floatType, floatType, nop);
   514         enterUnop("+", longType, longType, nop);
   515         enterUnop("+", intType, intType, nop);
   517         enterUnop("-", doubleType, doubleType, dneg);
   518         enterUnop("-", floatType, floatType, fneg);
   519         enterUnop("-", longType, longType, lneg);
   520         enterUnop("-", intType, intType, ineg);
   522         enterUnop("~", longType, longType, lxor);
   523         enterUnop("~", intType, intType, ixor);
   525         enterUnop("++", doubleType, doubleType, dadd);
   526         enterUnop("++", floatType, floatType, fadd);
   527         enterUnop("++", longType, longType, ladd);
   528         enterUnop("++", intType, intType, iadd);
   529         enterUnop("++", charType, charType, iadd);
   530         enterUnop("++", shortType, shortType, iadd);
   531         enterUnop("++", byteType, byteType, iadd);
   533         enterUnop("--", doubleType, doubleType, dsub);
   534         enterUnop("--", floatType, floatType, fsub);
   535         enterUnop("--", longType, longType, lsub);
   536         enterUnop("--", intType, intType, isub);
   537         enterUnop("--", charType, charType, isub);
   538         enterUnop("--", shortType, shortType, isub);
   539         enterUnop("--", byteType, byteType, isub);
   541         enterUnop("!", booleanType, booleanType, bool_not);
   542         nullcheck = enterUnop("<*nullchk*>", objectType, objectType, nullchk);
   544         // string concatenation
   545         enterBinop("+", stringType, objectType, stringType, string_add);
   546         enterBinop("+", objectType, stringType, stringType, string_add);
   547         enterBinop("+", stringType, stringType, stringType, string_add);
   548         enterBinop("+", stringType, intType, stringType, string_add);
   549         enterBinop("+", stringType, longType, stringType, string_add);
   550         enterBinop("+", stringType, floatType, stringType, string_add);
   551         enterBinop("+", stringType, doubleType, stringType, string_add);
   552         enterBinop("+", stringType, booleanType, stringType, string_add);
   553         enterBinop("+", stringType, botType, stringType, string_add);
   554         enterBinop("+", intType, stringType, stringType, string_add);
   555         enterBinop("+", longType, stringType, stringType, string_add);
   556         enterBinop("+", floatType, stringType, stringType, string_add);
   557         enterBinop("+", doubleType, stringType, stringType, string_add);
   558         enterBinop("+", booleanType, stringType, stringType, string_add);
   559         enterBinop("+", botType, stringType, stringType, string_add);
   561         // these errors would otherwise be matched as string concatenation
   562         enterBinop("+", botType, botType, botType, error);
   563         enterBinop("+", botType, intType, botType, error);
   564         enterBinop("+", botType, longType, botType, error);
   565         enterBinop("+", botType, floatType, botType, error);
   566         enterBinop("+", botType, doubleType, botType, error);
   567         enterBinop("+", botType, booleanType, botType, error);
   568         enterBinop("+", botType, objectType, botType, error);
   569         enterBinop("+", intType, botType, botType, error);
   570         enterBinop("+", longType, botType, botType, error);
   571         enterBinop("+", floatType, botType, botType, error);
   572         enterBinop("+", doubleType, botType, botType, error);
   573         enterBinop("+", booleanType, botType, botType, error);
   574         enterBinop("+", objectType, botType, botType, error);
   576         enterBinop("+", doubleType, doubleType, doubleType, dadd);
   577         enterBinop("+", floatType, floatType, floatType, fadd);
   578         enterBinop("+", longType, longType, longType, ladd);
   579         enterBinop("+", intType, intType, intType, iadd);
   581         enterBinop("-", doubleType, doubleType, doubleType, dsub);
   582         enterBinop("-", floatType, floatType, floatType, fsub);
   583         enterBinop("-", longType, longType, longType, lsub);
   584         enterBinop("-", intType, intType, intType, isub);
   586         enterBinop("*", doubleType, doubleType, doubleType, dmul);
   587         enterBinop("*", floatType, floatType, floatType, fmul);
   588         enterBinop("*", longType, longType, longType, lmul);
   589         enterBinop("*", intType, intType, intType, imul);
   591         enterBinop("/", doubleType, doubleType, doubleType, ddiv);
   592         enterBinop("/", floatType, floatType, floatType, fdiv);
   593         enterBinop("/", longType, longType, longType, ldiv);
   594         enterBinop("/", intType, intType, intType, idiv);
   596         enterBinop("%", doubleType, doubleType, doubleType, dmod);
   597         enterBinop("%", floatType, floatType, floatType, fmod);
   598         enterBinop("%", longType, longType, longType, lmod);
   599         enterBinop("%", intType, intType, intType, imod);
   601         enterBinop("&", booleanType, booleanType, booleanType, iand);
   602         enterBinop("&", longType, longType, longType, land);
   603         enterBinop("&", intType, intType, intType, iand);
   605         enterBinop("|", booleanType, booleanType, booleanType, ior);
   606         enterBinop("|", longType, longType, longType, lor);
   607         enterBinop("|", intType, intType, intType, ior);
   609         enterBinop("^", booleanType, booleanType, booleanType, ixor);
   610         enterBinop("^", longType, longType, longType, lxor);
   611         enterBinop("^", intType, intType, intType, ixor);
   613         enterBinop("<<", longType, longType, longType, lshll);
   614         enterBinop("<<", intType, longType, intType, ishll);
   615         enterBinop("<<", longType, intType, longType, lshl);
   616         enterBinop("<<", intType, intType, intType, ishl);
   618         enterBinop(">>", longType, longType, longType, lshrl);
   619         enterBinop(">>", intType, longType, intType, ishrl);
   620         enterBinop(">>", longType, intType, longType, lshr);
   621         enterBinop(">>", intType, intType, intType, ishr);
   623         enterBinop(">>>", longType, longType, longType, lushrl);
   624         enterBinop(">>>", intType, longType, intType, iushrl);
   625         enterBinop(">>>", longType, intType, longType, lushr);
   626         enterBinop(">>>", intType, intType, intType, iushr);
   628         enterBinop("<", doubleType, doubleType, booleanType, dcmpg, iflt);
   629         enterBinop("<", floatType, floatType, booleanType, fcmpg, iflt);
   630         enterBinop("<", longType, longType, booleanType, lcmp, iflt);
   631         enterBinop("<", intType, intType, booleanType, if_icmplt);
   633         enterBinop(">", doubleType, doubleType, booleanType, dcmpl, ifgt);
   634         enterBinop(">", floatType, floatType, booleanType, fcmpl, ifgt);
   635         enterBinop(">", longType, longType, booleanType, lcmp, ifgt);
   636         enterBinop(">", intType, intType, booleanType, if_icmpgt);
   638         enterBinop("<=", doubleType, doubleType, booleanType, dcmpg, ifle);
   639         enterBinop("<=", floatType, floatType, booleanType, fcmpg, ifle);
   640         enterBinop("<=", longType, longType, booleanType, lcmp, ifle);
   641         enterBinop("<=", intType, intType, booleanType, if_icmple);
   643         enterBinop(">=", doubleType, doubleType, booleanType, dcmpl, ifge);
   644         enterBinop(">=", floatType, floatType, booleanType, fcmpl, ifge);
   645         enterBinop(">=", longType, longType, booleanType, lcmp, ifge);
   646         enterBinop(">=", intType, intType, booleanType, if_icmpge);
   648         enterBinop("==", objectType, objectType, booleanType, if_acmpeq);
   649         enterBinop("==", booleanType, booleanType, booleanType, if_icmpeq);
   650         enterBinop("==", doubleType, doubleType, booleanType, dcmpl, ifeq);
   651         enterBinop("==", floatType, floatType, booleanType, fcmpl, ifeq);
   652         enterBinop("==", longType, longType, booleanType, lcmp, ifeq);
   653         enterBinop("==", intType, intType, booleanType, if_icmpeq);
   655         enterBinop("!=", objectType, objectType, booleanType, if_acmpne);
   656         enterBinop("!=", booleanType, booleanType, booleanType, if_icmpne);
   657         enterBinop("!=", doubleType, doubleType, booleanType, dcmpl, ifne);
   658         enterBinop("!=", floatType, floatType, booleanType, fcmpl, ifne);
   659         enterBinop("!=", longType, longType, booleanType, lcmp, ifne);
   660         enterBinop("!=", intType, intType, booleanType, if_icmpne);
   662         enterBinop("&&", booleanType, booleanType, booleanType, bool_and);
   663         enterBinop("||", booleanType, booleanType, booleanType, bool_or);
   664     }
   665 }

mercurial