Fri, 29 Oct 2010 12:47:49 -0700
6993304: JavacTrees.getAttrContext not updated to Tree.Kind.{ANNOTATION_TYPE,ENUM,INTERFACE}
Reviewed-by: mcimadamore
1 /*
2 * Copyright (c) 1999, 2008, 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 Scope.ScopeCounter scopeCounter;
78 private final ClassReader reader;
79 private final Target target;
81 /** A symbol for the root package.
82 */
83 public final PackageSymbol rootPackage;
85 /** A symbol for the unnamed package.
86 */
87 public final PackageSymbol unnamedPackage;
89 /** A symbol that stands for a missing symbol.
90 */
91 public final TypeSymbol noSymbol;
93 /** The error symbol.
94 */
95 public final ClassSymbol errSymbol;
97 /** The unknown symbol.
98 */
99 public final ClassSymbol unknownSymbol;
101 /** A value for the errType, with a originalType of noType */
102 public final Type errType;
104 /** A value for the unknown type. */
105 public final Type unknownType;
107 /** The builtin type of all arrays. */
108 public final ClassSymbol arrayClass;
109 public final MethodSymbol arrayCloneMethod;
111 /** VGJ: The (singleton) type of all bound types. */
112 public final ClassSymbol boundClass;
114 /** The builtin type of all methods. */
115 public final ClassSymbol methodClass;
117 /** Predefined types.
118 */
119 public final Type objectType;
120 public final Type classType;
121 public final Type classLoaderType;
122 public final Type stringType;
123 public final Type stringBufferType;
124 public final Type stringBuilderType;
125 public final Type cloneableType;
126 public final Type serializableType;
127 public final Type methodHandleType;
128 public final Type polymorphicSignatureType;
129 public final Type invokeDynamicType;
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;
158 /** The symbol representing the length field of an array.
159 */
160 public final VarSymbol lengthVar;
162 /** The null check operator. */
163 public final OperatorSymbol nullcheck;
165 /** The symbol representing the final finalize method on enums */
166 public final MethodSymbol enumFinalFinalize;
168 /** The symbol representing the close method on TWR AutoCloseable type */
169 public final MethodSymbol autoCloseableClose;
171 /** The predefined type that belongs to a tag.
172 */
173 public final Type[] typeOfTag = new Type[TypeTags.TypeTagCount];
175 /** The name of the class that belongs to a basix type tag.
176 */
177 public final Name[] boxedName = new Name[TypeTags.TypeTagCount];
179 /** A hashtable containing the encountered top-level and member classes,
180 * indexed by flat names. The table does not contain local classes.
181 * It should be updated from the outside to reflect classes defined
182 * by compiled source files.
183 */
184 public final Map<Name, ClassSymbol> classes = new HashMap<Name, ClassSymbol>();
186 /** A hashtable containing the encountered packages.
187 * the table should be updated from outside to reflect packages defined
188 * by compiled source files.
189 */
190 public final Map<Name, PackageSymbol> packages = new HashMap<Name, PackageSymbol>();
192 public void initType(Type type, ClassSymbol c) {
193 type.tsym = c;
194 typeOfTag[type.tag] = type;
195 }
197 public void initType(Type type, String name) {
198 initType(
199 type,
200 new ClassSymbol(
201 PUBLIC, names.fromString(name), type, rootPackage));
202 }
204 public void initType(Type type, String name, String bname) {
205 initType(type, name);
206 boxedName[type.tag] = names.fromString("java.lang." + bname);
207 }
209 /** The class symbol that owns all predefined symbols.
210 */
211 public final ClassSymbol predefClass;
213 /** Enter a constant into symbol table.
214 * @param name The constant's name.
215 * @param type The constant's type.
216 */
217 private VarSymbol enterConstant(String name, Type type) {
218 VarSymbol c = new VarSymbol(
219 PUBLIC | STATIC | FINAL,
220 names.fromString(name),
221 type,
222 predefClass);
223 c.setData(type.constValue());
224 predefClass.members().enter(c);
225 return c;
226 }
228 /** Enter a binary operation into symbol table.
229 * @param name The name of the operator.
230 * @param left The type of the left operand.
231 * @param right The type of the left operand.
232 * @param res The operation's result type.
233 * @param opcode The operation's bytecode instruction.
234 */
235 private void enterBinop(String name,
236 Type left, Type right, Type res,
237 int opcode) {
238 predefClass.members().enter(
239 new OperatorSymbol(
240 names.fromString(name),
241 new MethodType(List.of(left, right), res,
242 List.<Type>nil(), methodClass),
243 opcode,
244 predefClass));
245 }
247 /** Enter a binary operation, as above but with two opcodes,
248 * which get encoded as (opcode1 << ByteCodeTags.preShift) + opcode2.
249 * @param opcode1 First opcode.
250 * @param opcode2 Second opcode.
251 */
252 private void enterBinop(String name,
253 Type left, Type right, Type res,
254 int opcode1, int opcode2) {
255 enterBinop(
256 name, left, right, res, (opcode1 << ByteCodes.preShift) | opcode2);
257 }
259 /** Enter a unary operation into symbol table.
260 * @param name The name of the operator.
261 * @param arg The type of the operand.
262 * @param res The operation's result type.
263 * @param opcode The operation's bytecode instruction.
264 */
265 private OperatorSymbol enterUnop(String name,
266 Type arg,
267 Type res,
268 int opcode) {
269 OperatorSymbol sym =
270 new OperatorSymbol(names.fromString(name),
271 new MethodType(List.of(arg),
272 res,
273 List.<Type>nil(),
274 methodClass),
275 opcode,
276 predefClass);
277 predefClass.members().enter(sym);
278 return sym;
279 }
281 /** Enter a class into symbol table.
282 * @param The name of the class.
283 */
284 private Type enterClass(String s) {
285 return reader.enterClass(names.fromString(s)).type;
286 }
288 public void synthesizeEmptyInterfaceIfMissing(final Type type) {
289 final Completer completer = type.tsym.completer;
290 if (completer != null) {
291 type.tsym.completer = new Completer() {
292 public void complete(Symbol sym) throws CompletionFailure {
293 try {
294 completer.complete(sym);
295 } catch (CompletionFailure e) {
296 sym.flags_field |= (PUBLIC | INTERFACE);
297 ((ClassType) sym.type).supertype_field = objectType;
298 }
299 }
300 };
301 }
302 }
304 public void synthesizeBoxTypeIfMissing(final Type type) {
305 ClassSymbol sym = reader.enterClass(boxedName[type.tag]);
306 final Completer completer = sym.completer;
307 if (completer != null) {
308 sym.completer = new Completer() {
309 public void complete(Symbol sym) throws CompletionFailure {
310 try {
311 completer.complete(sym);
312 } catch (CompletionFailure e) {
313 sym.flags_field |= PUBLIC;
314 ((ClassType) sym.type).supertype_field = objectType;
315 Name n = target.boxWithConstructors() ? names.init : names.valueOf;
316 MethodSymbol boxMethod =
317 new MethodSymbol(PUBLIC | STATIC,
318 n,
319 new MethodType(List.of(type), sym.type,
320 List.<Type>nil(), methodClass),
321 sym);
322 sym.members().enter(boxMethod);
323 MethodSymbol unboxMethod =
324 new MethodSymbol(PUBLIC,
325 type.tsym.name.append(names.Value), // x.intValue()
326 new MethodType(List.<Type>nil(), type,
327 List.<Type>nil(), methodClass),
328 sym);
329 sym.members().enter(unboxMethod);
330 }
331 }
332 };
333 }
335 }
337 /** Constructor; enters all predefined identifiers and operators
338 * into symbol table.
339 */
340 protected Symtab(Context context) throws CompletionFailure {
341 context.put(symtabKey, this);
343 names = Names.instance(context);
344 scopeCounter = Scope.ScopeCounter.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.ClassScope(predefClass, scopeCounter);
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 methodHandleType = enterClass("java.dyn.MethodHandle");
423 polymorphicSignatureType = enterClass("java.dyn.MethodHandle$PolymorphicSignature");
424 invokeDynamicType = enterClass("java.dyn.InvokeDynamic");
425 errorType = enterClass("java.lang.Error");
426 illegalArgumentExceptionType = enterClass("java.lang.IllegalArgumentException");
427 exceptionType = enterClass("java.lang.Exception");
428 runtimeExceptionType = enterClass("java.lang.RuntimeException");
429 classNotFoundExceptionType = enterClass("java.lang.ClassNotFoundException");
430 noClassDefFoundErrorType = enterClass("java.lang.NoClassDefFoundError");
431 noSuchFieldErrorType = enterClass("java.lang.NoSuchFieldError");
432 assertionErrorType = enterClass("java.lang.AssertionError");
433 cloneNotSupportedExceptionType = enterClass("java.lang.CloneNotSupportedException");
434 annotationType = enterClass("java.lang.annotation.Annotation");
435 classLoaderType = enterClass("java.lang.ClassLoader");
436 enumSym = reader.enterClass(names.java_lang_Enum);
437 enumFinalFinalize =
438 new MethodSymbol(PROTECTED|FINAL|HYPOTHETICAL,
439 names.finalize,
440 new MethodType(List.<Type>nil(), voidType,
441 List.<Type>nil(), methodClass),
442 enumSym);
443 listType = enterClass("java.util.List");
444 collectionsType = enterClass("java.util.Collections");
445 comparableType = enterClass("java.lang.Comparable");
446 arraysType = enterClass("java.util.Arrays");
447 iterableType = target.hasIterable()
448 ? enterClass("java.lang.Iterable")
449 : enterClass("java.util.Collection");
450 iteratorType = enterClass("java.util.Iterator");
451 annotationTargetType = enterClass("java.lang.annotation.Target");
452 overrideType = enterClass("java.lang.Override");
453 retentionType = enterClass("java.lang.annotation.Retention");
454 deprecatedType = enterClass("java.lang.Deprecated");
455 suppressWarningsType = enterClass("java.lang.SuppressWarnings");
456 inheritedType = enterClass("java.lang.annotation.Inherited");
457 systemType = enterClass("java.lang.System");
458 autoCloseableType = enterClass("java.lang.AutoCloseable");
459 autoCloseableClose = new MethodSymbol(PUBLIC,
460 names.close,
461 new MethodType(List.<Type>nil(), voidType,
462 List.of(exceptionType), methodClass),
463 autoCloseableType.tsym);
465 synthesizeEmptyInterfaceIfMissing(cloneableType);
466 synthesizeEmptyInterfaceIfMissing(serializableType);
467 synthesizeEmptyInterfaceIfMissing(polymorphicSignatureType);
468 synthesizeBoxTypeIfMissing(doubleType);
469 synthesizeBoxTypeIfMissing(floatType);
470 synthesizeBoxTypeIfMissing(voidType);
472 // Enter a synthetic class that is used to mark internal
473 // proprietary classes in ct.sym. This class does not have a
474 // class file.
475 ClassType proprietaryType = (ClassType)enterClass("sun.Proprietary+Annotation");
476 this.proprietaryType = proprietaryType;
477 ClassSymbol proprietarySymbol = (ClassSymbol)proprietaryType.tsym;
478 proprietarySymbol.completer = null;
479 proprietarySymbol.flags_field = PUBLIC|ACYCLIC|ANNOTATION|INTERFACE;
480 proprietarySymbol.erasure_field = proprietaryType;
481 proprietarySymbol.members_field = new Scope.ClassScope(proprietarySymbol, scopeCounter);
482 proprietaryType.typarams_field = List.nil();
483 proprietaryType.allparams_field = List.nil();
484 proprietaryType.supertype_field = annotationType;
485 proprietaryType.interfaces_field = List.nil();
487 // Enter a class for arrays.
488 // The class implements java.lang.Cloneable and java.io.Serializable.
489 // It has a final length field and a clone method.
490 ClassType arrayClassType = (ClassType)arrayClass.type;
491 arrayClassType.supertype_field = objectType;
492 arrayClassType.interfaces_field = List.of(cloneableType, serializableType);
493 arrayClass.members_field = new Scope.ClassScope(arrayClass, scopeCounter);
494 lengthVar = new VarSymbol(
495 PUBLIC | FINAL,
496 names.length,
497 intType,
498 arrayClass);
499 arrayClass.members().enter(lengthVar);
500 arrayCloneMethod = new MethodSymbol(
501 PUBLIC,
502 names.clone,
503 new MethodType(List.<Type>nil(), objectType,
504 List.<Type>nil(), methodClass),
505 arrayClass);
506 arrayClass.members().enter(arrayCloneMethod);
508 // Enter operators.
509 enterUnop("+", doubleType, doubleType, nop);
510 enterUnop("+", floatType, floatType, nop);
511 enterUnop("+", longType, longType, nop);
512 enterUnop("+", intType, intType, nop);
514 enterUnop("-", doubleType, doubleType, dneg);
515 enterUnop("-", floatType, floatType, fneg);
516 enterUnop("-", longType, longType, lneg);
517 enterUnop("-", intType, intType, ineg);
519 enterUnop("~", longType, longType, lxor);
520 enterUnop("~", intType, intType, ixor);
522 enterUnop("++", doubleType, doubleType, dadd);
523 enterUnop("++", floatType, floatType, fadd);
524 enterUnop("++", longType, longType, ladd);
525 enterUnop("++", intType, intType, iadd);
526 enterUnop("++", charType, charType, iadd);
527 enterUnop("++", shortType, shortType, iadd);
528 enterUnop("++", byteType, byteType, iadd);
530 enterUnop("--", doubleType, doubleType, dsub);
531 enterUnop("--", floatType, floatType, fsub);
532 enterUnop("--", longType, longType, lsub);
533 enterUnop("--", intType, intType, isub);
534 enterUnop("--", charType, charType, isub);
535 enterUnop("--", shortType, shortType, isub);
536 enterUnop("--", byteType, byteType, isub);
538 enterUnop("!", booleanType, booleanType, bool_not);
539 nullcheck = enterUnop("<*nullchk*>", objectType, objectType, nullchk);
541 // string concatenation
542 enterBinop("+", stringType, objectType, stringType, string_add);
543 enterBinop("+", objectType, stringType, stringType, string_add);
544 enterBinop("+", stringType, stringType, stringType, string_add);
545 enterBinop("+", stringType, intType, stringType, string_add);
546 enterBinop("+", stringType, longType, stringType, string_add);
547 enterBinop("+", stringType, floatType, stringType, string_add);
548 enterBinop("+", stringType, doubleType, stringType, string_add);
549 enterBinop("+", stringType, booleanType, stringType, string_add);
550 enterBinop("+", stringType, botType, stringType, string_add);
551 enterBinop("+", intType, stringType, stringType, string_add);
552 enterBinop("+", longType, stringType, stringType, string_add);
553 enterBinop("+", floatType, stringType, stringType, string_add);
554 enterBinop("+", doubleType, stringType, stringType, string_add);
555 enterBinop("+", booleanType, stringType, stringType, string_add);
556 enterBinop("+", botType, stringType, stringType, string_add);
558 // these errors would otherwise be matched as string concatenation
559 enterBinop("+", botType, botType, botType, error);
560 enterBinop("+", botType, intType, botType, error);
561 enterBinop("+", botType, longType, botType, error);
562 enterBinop("+", botType, floatType, botType, error);
563 enterBinop("+", botType, doubleType, botType, error);
564 enterBinop("+", botType, booleanType, botType, error);
565 enterBinop("+", botType, objectType, botType, error);
566 enterBinop("+", intType, botType, botType, error);
567 enterBinop("+", longType, botType, botType, error);
568 enterBinop("+", floatType, botType, botType, error);
569 enterBinop("+", doubleType, botType, botType, error);
570 enterBinop("+", booleanType, botType, botType, error);
571 enterBinop("+", objectType, botType, botType, error);
573 enterBinop("+", doubleType, doubleType, doubleType, dadd);
574 enterBinop("+", floatType, floatType, floatType, fadd);
575 enterBinop("+", longType, longType, longType, ladd);
576 enterBinop("+", intType, intType, intType, iadd);
578 enterBinop("-", doubleType, doubleType, doubleType, dsub);
579 enterBinop("-", floatType, floatType, floatType, fsub);
580 enterBinop("-", longType, longType, longType, lsub);
581 enterBinop("-", intType, intType, intType, isub);
583 enterBinop("*", doubleType, doubleType, doubleType, dmul);
584 enterBinop("*", floatType, floatType, floatType, fmul);
585 enterBinop("*", longType, longType, longType, lmul);
586 enterBinop("*", intType, intType, intType, imul);
588 enterBinop("/", doubleType, doubleType, doubleType, ddiv);
589 enterBinop("/", floatType, floatType, floatType, fdiv);
590 enterBinop("/", longType, longType, longType, ldiv);
591 enterBinop("/", intType, intType, intType, idiv);
593 enterBinop("%", doubleType, doubleType, doubleType, dmod);
594 enterBinop("%", floatType, floatType, floatType, fmod);
595 enterBinop("%", longType, longType, longType, lmod);
596 enterBinop("%", intType, intType, intType, imod);
598 enterBinop("&", booleanType, booleanType, booleanType, iand);
599 enterBinop("&", longType, longType, longType, land);
600 enterBinop("&", intType, intType, intType, iand);
602 enterBinop("|", booleanType, booleanType, booleanType, ior);
603 enterBinop("|", longType, longType, longType, lor);
604 enterBinop("|", intType, intType, intType, ior);
606 enterBinop("^", booleanType, booleanType, booleanType, ixor);
607 enterBinop("^", longType, longType, longType, lxor);
608 enterBinop("^", intType, intType, intType, ixor);
610 enterBinop("<<", longType, longType, longType, lshll);
611 enterBinop("<<", intType, longType, intType, ishll);
612 enterBinop("<<", longType, intType, longType, lshl);
613 enterBinop("<<", intType, intType, intType, ishl);
615 enterBinop(">>", longType, longType, longType, lshrl);
616 enterBinop(">>", intType, longType, intType, ishrl);
617 enterBinop(">>", longType, intType, longType, lshr);
618 enterBinop(">>", intType, intType, intType, ishr);
620 enterBinop(">>>", longType, longType, longType, lushrl);
621 enterBinop(">>>", intType, longType, intType, iushrl);
622 enterBinop(">>>", longType, intType, longType, lushr);
623 enterBinop(">>>", intType, intType, intType, iushr);
625 enterBinop("<", doubleType, doubleType, booleanType, dcmpg, iflt);
626 enterBinop("<", floatType, floatType, booleanType, fcmpg, iflt);
627 enterBinop("<", longType, longType, booleanType, lcmp, iflt);
628 enterBinop("<", intType, intType, booleanType, if_icmplt);
630 enterBinop(">", doubleType, doubleType, booleanType, dcmpl, ifgt);
631 enterBinop(">", floatType, floatType, booleanType, fcmpl, ifgt);
632 enterBinop(">", longType, longType, booleanType, lcmp, ifgt);
633 enterBinop(">", intType, intType, booleanType, if_icmpgt);
635 enterBinop("<=", doubleType, doubleType, booleanType, dcmpg, ifle);
636 enterBinop("<=", floatType, floatType, booleanType, fcmpg, ifle);
637 enterBinop("<=", longType, longType, booleanType, lcmp, ifle);
638 enterBinop("<=", intType, intType, booleanType, if_icmple);
640 enterBinop(">=", doubleType, doubleType, booleanType, dcmpl, ifge);
641 enterBinop(">=", floatType, floatType, booleanType, fcmpl, ifge);
642 enterBinop(">=", longType, longType, booleanType, lcmp, ifge);
643 enterBinop(">=", intType, intType, booleanType, if_icmpge);
645 enterBinop("==", objectType, objectType, booleanType, if_acmpeq);
646 enterBinop("==", booleanType, booleanType, booleanType, if_icmpeq);
647 enterBinop("==", doubleType, doubleType, booleanType, dcmpl, ifeq);
648 enterBinop("==", floatType, floatType, booleanType, fcmpl, ifeq);
649 enterBinop("==", longType, longType, booleanType, lcmp, ifeq);
650 enterBinop("==", intType, intType, booleanType, if_icmpeq);
652 enterBinop("!=", objectType, objectType, booleanType, if_acmpne);
653 enterBinop("!=", booleanType, booleanType, booleanType, if_icmpne);
654 enterBinop("!=", doubleType, doubleType, booleanType, dcmpl, ifne);
655 enterBinop("!=", floatType, floatType, booleanType, fcmpl, ifne);
656 enterBinop("!=", longType, longType, booleanType, lcmp, ifne);
657 enterBinop("!=", intType, intType, booleanType, if_icmpne);
659 enterBinop("&&", booleanType, booleanType, booleanType, bool_and);
660 enterBinop("||", booleanType, booleanType, booleanType, bool_or);
661 }
662 }