< prev index next >

src/hotspot/share/c1/c1_Instruction.hpp

Print this page




  55 class   AccessArray;
  56 class     ArrayLength;
  57 class     AccessIndexed;
  58 class       LoadIndexed;
  59 class       StoreIndexed;
  60 class   NegateOp;
  61 class   Op2;
  62 class     ArithmeticOp;
  63 class     ShiftOp;
  64 class     LogicOp;
  65 class     CompareOp;
  66 class     IfOp;
  67 class   Convert;
  68 class   NullCheck;
  69 class   TypeCast;
  70 class   OsrEntry;
  71 class   ExceptionObject;
  72 class   StateSplit;
  73 class     Invoke;
  74 class     NewInstance;

  75 class     NewArray;
  76 class       NewTypeArray;
  77 class       NewObjectArray;
  78 class       NewMultiArray;


  79 class     TypeCheck;
  80 class       CheckCast;
  81 class       InstanceOf;
  82 class     AccessMonitor;
  83 class       MonitorEnter;
  84 class       MonitorExit;
  85 class     Intrinsic;
  86 class     BlockBegin;
  87 class     BlockEnd;
  88 class       Goto;
  89 class       If;
  90 class       IfInstanceOf;
  91 class       Switch;
  92 class         TableSwitch;
  93 class         LookupSwitch;
  94 class       Return;
  95 class       Throw;
  96 class       Base;
  97 class   RoundFP;
  98 class   UnsafeOp;


 160  public:
 161   virtual void do_Phi            (Phi*             x) = 0;
 162   virtual void do_Local          (Local*           x) = 0;
 163   virtual void do_Constant       (Constant*        x) = 0;
 164   virtual void do_LoadField      (LoadField*       x) = 0;
 165   virtual void do_StoreField     (StoreField*      x) = 0;
 166   virtual void do_ArrayLength    (ArrayLength*     x) = 0;
 167   virtual void do_LoadIndexed    (LoadIndexed*     x) = 0;
 168   virtual void do_StoreIndexed   (StoreIndexed*    x) = 0;
 169   virtual void do_NegateOp       (NegateOp*        x) = 0;
 170   virtual void do_ArithmeticOp   (ArithmeticOp*    x) = 0;
 171   virtual void do_ShiftOp        (ShiftOp*         x) = 0;
 172   virtual void do_LogicOp        (LogicOp*         x) = 0;
 173   virtual void do_CompareOp      (CompareOp*       x) = 0;
 174   virtual void do_IfOp           (IfOp*            x) = 0;
 175   virtual void do_Convert        (Convert*         x) = 0;
 176   virtual void do_NullCheck      (NullCheck*       x) = 0;
 177   virtual void do_TypeCast       (TypeCast*        x) = 0;
 178   virtual void do_Invoke         (Invoke*          x) = 0;
 179   virtual void do_NewInstance    (NewInstance*     x) = 0;

 180   virtual void do_NewTypeArray   (NewTypeArray*    x) = 0;
 181   virtual void do_NewObjectArray (NewObjectArray*  x) = 0;
 182   virtual void do_NewMultiArray  (NewMultiArray*   x) = 0;


 183   virtual void do_CheckCast      (CheckCast*       x) = 0;
 184   virtual void do_InstanceOf     (InstanceOf*      x) = 0;
 185   virtual void do_MonitorEnter   (MonitorEnter*    x) = 0;
 186   virtual void do_MonitorExit    (MonitorExit*     x) = 0;
 187   virtual void do_Intrinsic      (Intrinsic*       x) = 0;
 188   virtual void do_BlockBegin     (BlockBegin*      x) = 0;
 189   virtual void do_Goto           (Goto*            x) = 0;
 190   virtual void do_If             (If*              x) = 0;
 191   virtual void do_IfInstanceOf   (IfInstanceOf*    x) = 0;
 192   virtual void do_TableSwitch    (TableSwitch*     x) = 0;
 193   virtual void do_LookupSwitch   (LookupSwitch*    x) = 0;
 194   virtual void do_Return         (Return*          x) = 0;
 195   virtual void do_Throw          (Throw*           x) = 0;
 196   virtual void do_Base           (Base*            x) = 0;
 197   virtual void do_OsrEntry       (OsrEntry*        x) = 0;
 198   virtual void do_ExceptionObject(ExceptionObject* x) = 0;
 199   virtual void do_RoundFP        (RoundFP*         x) = 0;
 200   virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x) = 0;
 201   virtual void do_UnsafePutRaw   (UnsafePutRaw*    x) = 0;
 202   virtual void do_UnsafeGetObject(UnsafeGetObject* x) = 0;


 340           _nonnull_state |= nth_bit(i);
 341         } else {
 342           _nonnull_state &= ~(nth_bit(i));
 343         }
 344       }
 345     }
 346   };
 347 
 348  public:
 349   void* operator new(size_t size) throw() {
 350     Compilation* c = Compilation::current();
 351     void* res = c->arena()->Amalloc(size);
 352     ((Instruction*)res)->_id = c->get_next_id();
 353     return res;
 354   }
 355 
 356   static const int no_bci = -99;
 357 
 358   enum InstructionFlag {
 359     NeedsNullCheckFlag = 0,

 360     CanTrapFlag,
 361     DirectCompareFlag,
 362     IsEliminatedFlag,
 363     IsSafepointFlag,
 364     IsStaticFlag,
 365     IsStrictfpFlag,
 366     NeedsStoreCheckFlag,
 367     NeedsWriteBarrierFlag,
 368     PreservesStateFlag,
 369     TargetIsFinalFlag,
 370     TargetIsLoadedFlag,
 371     TargetIsStrictfpFlag,
 372     UnorderedIsTrueFlag,
 373     NeedsPatchingFlag,
 374     ThrowIncompatibleClassChangeErrorFlag,
 375     InvokeSpecialReceiverCheckFlag,
 376     ProfileMDOFlag,
 377     IsLinkedInBlockFlag,
 378     NeedsRangeCheckFlag,
 379     InWorkListFlag,


 434   int id() const                                 { return _id; }
 435 #ifndef PRODUCT
 436   bool has_printable_bci() const                 { return _printable_bci != -99; }
 437   int printable_bci() const                      { assert(has_printable_bci(), "_printable_bci should have been set"); return _printable_bci; }
 438   void set_printable_bci(int bci)                { _printable_bci = bci; }
 439 #endif
 440   int dominator_depth();
 441   int use_count() const                          { return _use_count; }
 442   int pin_state() const                          { return _pin_state; }
 443   bool is_pinned() const                         { return _pin_state != 0 || PinAllInstructions; }
 444   ValueType* type() const                        { return _type; }
 445   BlockBegin *block() const                      { return _block; }
 446   Instruction* prev();                           // use carefully, expensive operation
 447   Instruction* next() const                      { return _next; }
 448   bool has_subst() const                         { return _subst != NULL; }
 449   Instruction* subst()                           { return _subst == NULL ? this : _subst->subst(); }
 450   LIR_Opr operand() const                        { return _operand; }
 451 
 452   void set_needs_null_check(bool f)              { set_flag(NeedsNullCheckFlag, f); }
 453   bool needs_null_check() const                  { return check_flag(NeedsNullCheckFlag); }


 454   bool is_linked() const                         { return check_flag(IsLinkedInBlockFlag); }
 455   bool can_be_linked()                           { return as_Local() == NULL && as_Phi() == NULL; }
 456 
 457   bool has_uses() const                          { return use_count() > 0; }
 458   ValueStack* state_before() const               { return _state_before; }
 459   ValueStack* exception_state() const            { return _exception_state; }
 460   virtual bool needs_exception_state() const     { return true; }
 461   XHandlers* exception_handlers() const          { return _exception_handlers; }







 462 
 463   // manipulation
 464   void pin(PinReason reason)                     { _pin_state |= reason; }
 465   void pin()                                     { _pin_state |= PinUnknown; }
 466   // DANGEROUS: only used by EliminateStores
 467   void unpin(PinReason reason)                   { assert((reason & PinUnknown) == 0, "can't unpin unknown state"); _pin_state &= ~reason; }
 468 
 469   Instruction* set_next(Instruction* next) {
 470     assert(next->has_printable_bci(), "_printable_bci should have been set");
 471     assert(next != NULL, "must not be NULL");
 472     assert(as_BlockEnd() == NULL, "BlockEnd instructions must have no next");
 473     assert(next->can_be_linked(), "shouldn't link these instructions into list");
 474 
 475     BlockBegin *block = this->block();
 476     next->_block = block;
 477 
 478     next->set_flag(Instruction::IsLinkedInBlockFlag, true);
 479     _next = next;
 480     return next;
 481   }


 486 #endif
 487     return set_next(next);
 488   }
 489 
 490   // when blocks are merged
 491   void fixup_block_pointers() {
 492     Instruction *cur = next()->next(); // next()'s block is set in set_next
 493     while (cur && cur->_block != block()) {
 494       cur->_block = block();
 495       cur = cur->next();
 496     }
 497   }
 498 
 499   Instruction *insert_after(Instruction *i) {
 500     Instruction* n = _next;
 501     set_next(i);
 502     i->set_next(n);
 503     return _next;
 504   }
 505 




 506   Instruction *insert_after_same_bci(Instruction *i) {
 507 #ifndef PRODUCT
 508     i->set_printable_bci(printable_bci());
 509 #endif
 510     return insert_after(i);
 511   }
 512 
 513   void set_subst(Instruction* subst)             {
 514     assert(subst == NULL ||
 515            type()->base() == subst->type()->base() ||
 516            subst->type()->base() == illegalType, "type can't change");
 517     _subst = subst;
 518   }
 519   void set_exception_handlers(XHandlers *xhandlers) { _exception_handlers = xhandlers; }
 520   void set_exception_state(ValueStack* s)        { check_state(s); _exception_state = s; }
 521   void set_state_before(ValueStack* s)           { check_state(s); _state_before = s; }
 522 
 523   // machine-specifics
 524   void set_operand(LIR_Opr operand)              { assert(operand != LIR_OprFact::illegalOpr, "operand must exist"); _operand = operand; }
 525   void clear_operand()                           { _operand = LIR_OprFact::illegalOpr; }


 533   virtual LoadField*        as_LoadField()       { return NULL; }
 534   virtual StoreField*       as_StoreField()      { return NULL; }
 535   virtual AccessArray*      as_AccessArray()     { return NULL; }
 536   virtual ArrayLength*      as_ArrayLength()     { return NULL; }
 537   virtual AccessIndexed*    as_AccessIndexed()   { return NULL; }
 538   virtual LoadIndexed*      as_LoadIndexed()     { return NULL; }
 539   virtual StoreIndexed*     as_StoreIndexed()    { return NULL; }
 540   virtual NegateOp*         as_NegateOp()        { return NULL; }
 541   virtual Op2*              as_Op2()             { return NULL; }
 542   virtual ArithmeticOp*     as_ArithmeticOp()    { return NULL; }
 543   virtual ShiftOp*          as_ShiftOp()         { return NULL; }
 544   virtual LogicOp*          as_LogicOp()         { return NULL; }
 545   virtual CompareOp*        as_CompareOp()       { return NULL; }
 546   virtual IfOp*             as_IfOp()            { return NULL; }
 547   virtual Convert*          as_Convert()         { return NULL; }
 548   virtual NullCheck*        as_NullCheck()       { return NULL; }
 549   virtual OsrEntry*         as_OsrEntry()        { return NULL; }
 550   virtual StateSplit*       as_StateSplit()      { return NULL; }
 551   virtual Invoke*           as_Invoke()          { return NULL; }
 552   virtual NewInstance*      as_NewInstance()     { return NULL; }

 553   virtual NewArray*         as_NewArray()        { return NULL; }
 554   virtual NewTypeArray*     as_NewTypeArray()    { return NULL; }
 555   virtual NewObjectArray*   as_NewObjectArray()  { return NULL; }
 556   virtual NewMultiArray*    as_NewMultiArray()   { return NULL; }


 557   virtual TypeCheck*        as_TypeCheck()       { return NULL; }
 558   virtual CheckCast*        as_CheckCast()       { return NULL; }
 559   virtual InstanceOf*       as_InstanceOf()      { return NULL; }
 560   virtual TypeCast*         as_TypeCast()        { return NULL; }
 561   virtual AccessMonitor*    as_AccessMonitor()   { return NULL; }
 562   virtual MonitorEnter*     as_MonitorEnter()    { return NULL; }
 563   virtual MonitorExit*      as_MonitorExit()     { return NULL; }
 564   virtual Intrinsic*        as_Intrinsic()       { return NULL; }
 565   virtual BlockBegin*       as_BlockBegin()      { return NULL; }
 566   virtual BlockEnd*         as_BlockEnd()        { return NULL; }
 567   virtual Goto*             as_Goto()            { return NULL; }
 568   virtual If*               as_If()              { return NULL; }
 569   virtual IfInstanceOf*     as_IfInstanceOf()    { return NULL; }
 570   virtual TableSwitch*      as_TableSwitch()     { return NULL; }
 571   virtual LookupSwitch*     as_LookupSwitch()    { return NULL; }
 572   virtual Return*           as_Return()          { return NULL; }
 573   virtual Throw*            as_Throw()           { return NULL; }
 574   virtual Base*             as_Base()            { return NULL; }
 575   virtual RoundFP*          as_RoundFP()         { return NULL; }
 576   virtual ExceptionObject*  as_ExceptionObject() { return NULL; }


 686   }
 687 
 688   bool is_illegal() const {
 689     return type()->is_illegal();
 690   }
 691 
 692   // generic
 693   virtual void input_values_do(ValueVisitor* f) {
 694   }
 695 };
 696 
 697 
 698 // A local is a placeholder for an incoming argument to a function call.
 699 LEAF(Local, Instruction)
 700  private:
 701   int      _java_index;                          // the local index within the method to which the local belongs
 702   bool     _is_receiver;                         // if local variable holds the receiver: "this" for non-static methods
 703   ciType*  _declared_type;
 704  public:
 705   // creation
 706   Local(ciType* declared, ValueType* type, int index, bool receiver)
 707     : Instruction(type)
 708     , _java_index(index)
 709     , _is_receiver(receiver)
 710     , _declared_type(declared)
 711   {

 712     NOT_PRODUCT(set_printable_bci(-1));
 713   }
 714 
 715   // accessors
 716   int java_index() const                         { return _java_index; }
 717   bool is_receiver() const                       { return _is_receiver; }
 718 
 719   virtual ciType* declared_type() const          { return _declared_type; }
 720 
 721   // generic
 722   virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
 723 };
 724 
 725 
 726 LEAF(Constant, Instruction)
 727  public:
 728   // creation
 729   Constant(ValueType* type):
 730       Instruction(type, NULL, /*type_is_constant*/ true)
 731   {


 811 
 812   // manipulation
 813 
 814   // Under certain circumstances, if a previous NullCheck instruction
 815   // proved the target object non-null, we can eliminate the explicit
 816   // null check and do an implicit one, simply specifying the debug
 817   // information from the NullCheck. This field should only be consulted
 818   // if needs_null_check() is true.
 819   void set_explicit_null_check(NullCheck* check) { _explicit_null_check = check; }
 820 
 821   // generic
 822   virtual bool can_trap() const                  { return needs_null_check() || needs_patching(); }
 823   virtual void input_values_do(ValueVisitor* f)   { f->visit(&_obj); }
 824 };
 825 
 826 
 827 LEAF(LoadField, AccessField)
 828  public:
 829   // creation
 830   LoadField(Value obj, int offset, ciField* field, bool is_static,
 831             ValueStack* state_before, bool needs_patching)

 832   : AccessField(obj, offset, field, is_static, state_before, needs_patching)
 833   {}
 834 
 835   ciType* declared_type() const;
 836 
 837   // generic
 838   HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset())  // cannot be eliminated if needs patching or if volatile
 839 };
 840 
 841 
 842 LEAF(StoreField, AccessField)
 843  private:
 844   Value _value;
 845 
 846  public:
 847   // creation
 848   StoreField(Value obj, int offset, ciField* field, Value value, bool is_static,
 849              ValueStack* state_before, bool needs_patching)
 850   : AccessField(obj, offset, field, is_static, state_before, needs_patching)
 851   , _value(value)


 930   }
 931 
 932   // accessors
 933   Value index() const                            { return _index; }
 934   Value length() const                           { return _length; }
 935   BasicType elt_type() const                     { return _elt_type; }
 936   bool mismatched() const                        { return _mismatched; }
 937 
 938   void clear_length()                            { _length = NULL; }
 939   // perform elimination of range checks involving constants
 940   bool compute_needs_range_check();
 941 
 942   // generic
 943   virtual void input_values_do(ValueVisitor* f)   { AccessArray::input_values_do(f); f->visit(&_index); if (_length != NULL) f->visit(&_length); }
 944 };
 945 
 946 
 947 LEAF(LoadIndexed, AccessIndexed)
 948  private:
 949   NullCheck*  _explicit_null_check;              // For explicit null check elimination

 950 
 951  public:
 952   // creation
 953   LoadIndexed(Value array, Value index, Value length, BasicType elt_type, ValueStack* state_before, bool mismatched = false)
 954   : AccessIndexed(array, index, length, elt_type, state_before, mismatched)
 955   , _explicit_null_check(NULL) {}
 956 
 957   // accessors
 958   NullCheck* explicit_null_check() const         { return _explicit_null_check; }
 959 
 960   // setters
 961   // See LoadField::set_explicit_null_check for documentation
 962   void set_explicit_null_check(NullCheck* check) { _explicit_null_check = check; }
 963 
 964   ciType* exact_type() const;
 965   ciType* declared_type() const;
 966 



 967   // generic
 968   HASHING2(LoadIndexed, true, array()->subst(), index()->subst())
 969 };
 970 
 971 
 972 LEAF(StoreIndexed, AccessIndexed)
 973  private:
 974   Value       _value;
 975 
 976   ciMethod* _profiled_method;
 977   int       _profiled_bci;
 978   bool      _check_boolean;
 979 
 980  public:
 981   // creation
 982   StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* state_before,
 983                bool check_boolean, bool mismatched = false)
 984   : AccessIndexed(array, index, length, elt_type, state_before, mismatched)
 985   , _value(value), _profiled_method(NULL), _profiled_bci(0), _check_boolean(check_boolean)
 986   {
 987     set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object()));
 988     set_flag(NeedsStoreCheckFlag, (as_ValueType(elt_type)->is_object()));
 989     ASSERT_VALUES
 990     pin();
 991   }
 992 
 993   // accessors
 994   Value value() const                            { return _value; }
 995   bool needs_write_barrier() const               { return check_flag(NeedsWriteBarrierFlag); }
 996   bool needs_store_check() const                 { return check_flag(NeedsStoreCheckFlag); }
 997   bool check_boolean() const                     { return _check_boolean; }
 998   // Helpers for MethodData* profiling
 999   void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
1000   void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
1001   void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
1002   bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
1003   ciMethod* profiled_method() const                  { return _profiled_method;     }
1004   int       profiled_bci() const                     { return _profiled_bci;        }


1005   // generic
1006   virtual void input_values_do(ValueVisitor* f)   { AccessIndexed::input_values_do(f); f->visit(&_value); }
1007 };
1008 
1009 
1010 LEAF(NegateOp, Instruction)
1011  private:
1012   Value _x;
1013 
1014  public:
1015   // creation
1016   NegateOp(Value x) : Instruction(x->type()->base()), _x(x) {
1017     ASSERT_VALUES
1018   }
1019 
1020   // accessors
1021   Value x() const                                { return _x; }
1022 
1023   // generic
1024   virtual void input_values_do(ValueVisitor* f)   { f->visit(&_x); }


1099   HASHING3(Op2, true, op(), x()->subst(), y()->subst())
1100 };
1101 
1102 
1103 LEAF(CompareOp, Op2)
1104  public:
1105   // creation
1106   CompareOp(Bytecodes::Code op, Value x, Value y, ValueStack* state_before)
1107   : Op2(intType, op, x, y, state_before)
1108   {}
1109 
1110   // generic
1111   HASHING3(Op2, true, op(), x()->subst(), y()->subst())
1112 };
1113 
1114 
1115 LEAF(IfOp, Op2)
1116  private:
1117   Value _tval;
1118   Value _fval;

1119 
1120  public:
1121   // creation
1122   IfOp(Value x, Condition cond, Value y, Value tval, Value fval)
1123   : Op2(tval->type()->meet(fval->type()), (Bytecodes::Code)cond, x, y)
1124   , _tval(tval)
1125   , _fval(fval)

1126   {
1127     ASSERT_VALUES
1128     assert(tval->type()->tag() == fval->type()->tag(), "types must match");

1129   }
1130 
1131   // accessors
1132   virtual bool is_commutative() const;
1133   Bytecodes::Code op() const                     { ShouldNotCallThis(); return Bytecodes::_illegal; }
1134   Condition cond() const                         { return (Condition)Op2::op(); }
1135   Value tval() const                             { return _tval; }
1136   Value fval() const                             { return _fval; }
1137 
1138   // generic
1139   virtual void input_values_do(ValueVisitor* f)   { Op2::input_values_do(f); f->visit(&_tval); f->visit(&_fval); }
1140 };
1141 
1142 
1143 LEAF(Convert, Instruction)
1144  private:
1145   Bytecodes::Code _op;
1146   Value           _value;
1147 
1148  public:
1149   // creation
1150   Convert(Bytecodes::Code op, Value value, ValueType* to_type) : Instruction(to_type), _op(op), _value(value) {
1151     ASSERT_VALUES
1152   }
1153 
1154   // accessors
1155   Bytecodes::Code op() const                     { return _op; }
1156   Value value() const                            { return _value; }
1157 


1237   void set_state(ValueStack* state)              { assert(_state == NULL, "overwriting existing state"); check_state(state); _state = state; }
1238 
1239   // generic
1240   virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
1241   virtual void state_values_do(ValueVisitor* f);
1242 };
1243 
1244 
1245 LEAF(Invoke, StateSplit)
1246  private:
1247   Bytecodes::Code _code;
1248   Value           _recv;
1249   Values*         _args;
1250   BasicTypeList*  _signature;
1251   int             _vtable_index;
1252   ciMethod*       _target;
1253 
1254  public:
1255   // creation
1256   Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args,
1257          int vtable_index, ciMethod* target, ValueStack* state_before);
1258 
1259   // accessors
1260   Bytecodes::Code code() const                   { return _code; }
1261   Value receiver() const                         { return _recv; }
1262   bool has_receiver() const                      { return receiver() != NULL; }
1263   int number_of_arguments() const                { return _args->length(); }
1264   Value argument_at(int i) const                 { return _args->at(i); }
1265   int vtable_index() const                       { return _vtable_index; }
1266   BasicTypeList* signature() const               { return _signature; }
1267   ciMethod* target() const                       { return _target; }
1268 
1269   ciType* declared_type() const;
1270 
1271   // Returns false if target is not loaded
1272   bool target_is_final() const                   { return check_flag(TargetIsFinalFlag); }
1273   bool target_is_loaded() const                  { return check_flag(TargetIsLoadedFlag); }
1274   // Returns false if target is not loaded
1275   bool target_is_strictfp() const                { return check_flag(TargetIsStrictfpFlag); }
1276 
1277   // JSR 292 support


1298 
1299  public:
1300   // creation
1301   NewInstance(ciInstanceKlass* klass, ValueStack* state_before, bool is_unresolved)
1302   : StateSplit(instanceType, state_before)
1303   , _klass(klass), _is_unresolved(is_unresolved)
1304   {}
1305 
1306   // accessors
1307   ciInstanceKlass* klass() const                 { return _klass; }
1308   bool is_unresolved() const                     { return _is_unresolved; }
1309 
1310   virtual bool needs_exception_state() const     { return false; }
1311 
1312   // generic
1313   virtual bool can_trap() const                  { return true; }
1314   ciType* exact_type() const;
1315   ciType* declared_type() const;
1316 };
1317 























































1318 
1319 BASE(NewArray, StateSplit)
1320  private:
1321   Value       _length;
1322 
1323  public:
1324   // creation
1325   NewArray(Value length, ValueStack* state_before)
1326   : StateSplit(objectType, state_before)
1327   , _length(length)
1328   {
1329     // Do not ASSERT_VALUES since length is NULL for NewMultiArray
1330   }
1331 
1332   // accessors
1333   Value length() const                           { return _length; }
1334 
1335   virtual bool needs_exception_state() const     { return false; }
1336 
1337   ciType* exact_type() const                     { return NULL; }


1349 
1350  public:
1351   // creation
1352   NewTypeArray(Value length, BasicType elt_type, ValueStack* state_before)
1353   : NewArray(length, state_before)
1354   , _elt_type(elt_type)
1355   {}
1356 
1357   // accessors
1358   BasicType elt_type() const                     { return _elt_type; }
1359   ciType* exact_type() const;
1360 };
1361 
1362 
1363 LEAF(NewObjectArray, NewArray)
1364  private:
1365   ciKlass* _klass;
1366 
1367  public:
1368   // creation
1369   NewObjectArray(ciKlass* klass, Value length, ValueStack* state_before) : NewArray(length, state_before), _klass(klass) {}



1370 
1371   // accessors
1372   ciKlass* klass() const                         { return _klass; }
1373   ciType* exact_type() const;
1374 };
1375 
1376 
1377 LEAF(NewMultiArray, NewArray)
1378  private:
1379   ciKlass* _klass;
1380   Values*  _dims;
1381 
1382  public:
1383   // creation
1384   NewMultiArray(ciKlass* klass, Values* dims, ValueStack* state_before) : NewArray(NULL, state_before), _klass(klass), _dims(dims) {
1385     ASSERT_VALUES
1386   }
1387 
1388   // accessors
1389   ciKlass* klass() const                         { return _klass; }
1390   Values* dims() const                           { return _dims; }
1391   int rank() const                               { return dims()->length(); }
1392 
1393   // generic
1394   virtual void input_values_do(ValueVisitor* f) {
1395     // NOTE: we do not call NewArray::input_values_do since "length"
1396     // is meaningless for a multi-dimensional array; passing the
1397     // zeroth element down to NewArray as its length is a bad idea
1398     // since there will be a copy in the "dims" array which doesn't
1399     // get updated, and the value must not be traversed twice. Was bug
1400     // - kbr 4/10/2001
1401     StateSplit::input_values_do(f);
1402     for (int i = 0; i < _dims->length(); i++) f->visit(_dims->adr_at(i));
1403   }


1404 };
1405 













1406 
1407 BASE(TypeCheck, StateSplit)
1408  private:
1409   ciKlass*    _klass;
1410   Value       _obj;
1411 
1412   ciMethod* _profiled_method;
1413   int       _profiled_bci;
1414 
1415  public:
1416   // creation
1417   TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before)
1418   : StateSplit(type, state_before), _klass(klass), _obj(obj),
1419     _profiled_method(NULL), _profiled_bci(0) {
1420     ASSERT_VALUES
1421     set_direct_compare(false);
1422   }
1423 
1424   // accessors
1425   ciKlass* klass() const                         { return _klass; }


1430   // manipulation
1431   void set_direct_compare(bool flag)             { set_flag(DirectCompareFlag, flag); }
1432 
1433   // generic
1434   virtual bool can_trap() const                  { return true; }
1435   virtual void input_values_do(ValueVisitor* f)   { StateSplit::input_values_do(f); f->visit(&_obj); }
1436 
1437   // Helpers for MethodData* profiling
1438   void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
1439   void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
1440   void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
1441   bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
1442   ciMethod* profiled_method() const                  { return _profiled_method;     }
1443   int       profiled_bci() const                     { return _profiled_bci;        }
1444 };
1445 
1446 
1447 LEAF(CheckCast, TypeCheck)
1448  public:
1449   // creation
1450   CheckCast(ciKlass* klass, Value obj, ValueStack* state_before)
1451   : TypeCheck(klass, obj, objectType, state_before) {}


1452 
1453   void set_incompatible_class_change_check() {
1454     set_flag(ThrowIncompatibleClassChangeErrorFlag, true);
1455   }
1456   bool is_incompatible_class_change_check() const {
1457     return check_flag(ThrowIncompatibleClassChangeErrorFlag);
1458   }
1459   void set_invokespecial_receiver_check() {
1460     set_flag(InvokeSpecialReceiverCheckFlag, true);
1461   }
1462   bool is_invokespecial_receiver_check() const {
1463     return check_flag(InvokeSpecialReceiverCheckFlag);
1464   }
1465 
1466   virtual bool needs_exception_state() const {
1467     return !is_invokespecial_receiver_check();
1468   }
1469 
1470   ciType* declared_type() const;
1471 };


1489   // creation
1490   AccessMonitor(Value obj, int monitor_no, ValueStack* state_before = NULL)
1491   : StateSplit(illegalType, state_before)
1492   , _obj(obj)
1493   , _monitor_no(monitor_no)
1494   {
1495     set_needs_null_check(true);
1496     ASSERT_VALUES
1497   }
1498 
1499   // accessors
1500   Value obj() const                              { return _obj; }
1501   int monitor_no() const                         { return _monitor_no; }
1502 
1503   // generic
1504   virtual void input_values_do(ValueVisitor* f)   { StateSplit::input_values_do(f); f->visit(&_obj); }
1505 };
1506 
1507 
1508 LEAF(MonitorEnter, AccessMonitor)

1509  public:
1510   // creation
1511   MonitorEnter(Value obj, int monitor_no, ValueStack* state_before)
1512   : AccessMonitor(obj, monitor_no, state_before)

1513   {
1514     ASSERT_VALUES
1515   }
1516 



1517   // generic
1518   virtual bool can_trap() const                  { return true; }
1519 };
1520 
1521 
1522 LEAF(MonitorExit, AccessMonitor)
1523  public:
1524   // creation
1525   MonitorExit(Value obj, int monitor_no)
1526   : AccessMonitor(obj, monitor_no, NULL)
1527   {
1528     ASSERT_VALUES
1529   }
1530 };
1531 
1532 
1533 LEAF(Intrinsic, StateSplit)
1534  private:
1535   vmIntrinsics::ID _id;
1536   Values*          _args;


1962   Condition cond() const                         { return _cond; }
1963   bool unordered_is_true() const                 { return check_flag(UnorderedIsTrueFlag); }
1964   Value y() const                                { return _y; }
1965 
1966   void always_fail()                             { _x = _y = NULL; }
1967 
1968   // generic
1969   virtual void input_values_do(ValueVisitor* f)  { StateSplit::input_values_do(f); f->visit(&_x); f->visit(&_y); }
1970   HASHING3(RangeCheckPredicate, true, x()->subst(), y()->subst(), cond())
1971 };
1972 
1973 LEAF(If, BlockEnd)
1974  private:
1975   Value       _x;
1976   Condition   _cond;
1977   Value       _y;
1978   ciMethod*   _profiled_method;
1979   int         _profiled_bci; // Canonicalizer may alter bci of If node
1980   bool        _swapped;      // Is the order reversed with respect to the original If in the
1981                              // bytecode stream?

1982  public:
1983   // creation
1984   // unordered_is_true is valid for float/double compares only
1985   If(Value x, Condition cond, bool unordered_is_true, Value y, BlockBegin* tsux, BlockBegin* fsux, ValueStack* state_before, bool is_safepoint)
1986     : BlockEnd(illegalType, state_before, is_safepoint)
1987   , _x(x)
1988   , _cond(cond)
1989   , _y(y)
1990   , _profiled_method(NULL)
1991   , _profiled_bci(0)
1992   , _swapped(false)

1993   {
1994     ASSERT_VALUES
1995     set_flag(UnorderedIsTrueFlag, unordered_is_true);
1996     assert(x->type()->tag() == y->type()->tag(), "types must match");
1997     BlockList* s = new BlockList(2);
1998     s->append(tsux);
1999     s->append(fsux);
2000     set_sux(s);
2001   }
2002 
2003   // accessors
2004   Value x() const                                { return _x; }
2005   Condition cond() const                         { return _cond; }
2006   bool unordered_is_true() const                 { return check_flag(UnorderedIsTrueFlag); }
2007   Value y() const                                { return _y; }
2008   BlockBegin* sux_for(bool is_true) const        { return sux_at(is_true ? 0 : 1); }
2009   BlockBegin* tsux() const                       { return sux_for(true); }
2010   BlockBegin* fsux() const                       { return sux_for(false); }
2011   BlockBegin* usux() const                       { return sux_for(unordered_is_true()); }
2012   bool should_profile() const                    { return check_flag(ProfileMDOFlag); }


2015   bool is_swapped() const                        { return _swapped; }
2016 
2017   // manipulation
2018   void swap_operands() {
2019     Value t = _x; _x = _y; _y = t;
2020     _cond = mirror(_cond);
2021   }
2022 
2023   void swap_sux() {
2024     assert(number_of_sux() == 2, "wrong number of successors");
2025     BlockList* s = sux();
2026     BlockBegin* t = s->at(0); s->at_put(0, s->at(1)); s->at_put(1, t);
2027     _cond = negate(_cond);
2028     set_flag(UnorderedIsTrueFlag, !check_flag(UnorderedIsTrueFlag));
2029   }
2030 
2031   void set_should_profile(bool value)             { set_flag(ProfileMDOFlag, value); }
2032   void set_profiled_method(ciMethod* method)      { _profiled_method = method; }
2033   void set_profiled_bci(int bci)                  { _profiled_bci = bci;       }
2034   void set_swapped(bool value)                    { _swapped = value;         }

2035   // generic
2036   virtual void input_values_do(ValueVisitor* f)   { BlockEnd::input_values_do(f); f->visit(&_x); f->visit(&_y); }
2037 };
2038 
2039 
2040 LEAF(IfInstanceOf, BlockEnd)
2041  private:
2042   ciKlass* _klass;
2043   Value    _obj;
2044   bool     _test_is_instance;                    // jump if instance
2045   int      _instanceof_bci;
2046 
2047  public:
2048   IfInstanceOf(ciKlass* klass, Value obj, bool test_is_instance, int instanceof_bci, BlockBegin* tsux, BlockBegin* fsux)
2049   : BlockEnd(illegalType, NULL, false) // temporary set to false
2050   , _klass(klass)
2051   , _obj(obj)
2052   , _test_is_instance(test_is_instance)
2053   , _instanceof_bci(instanceof_bci)
2054   {




  55 class   AccessArray;
  56 class     ArrayLength;
  57 class     AccessIndexed;
  58 class       LoadIndexed;
  59 class       StoreIndexed;
  60 class   NegateOp;
  61 class   Op2;
  62 class     ArithmeticOp;
  63 class     ShiftOp;
  64 class     LogicOp;
  65 class     CompareOp;
  66 class     IfOp;
  67 class   Convert;
  68 class   NullCheck;
  69 class   TypeCast;
  70 class   OsrEntry;
  71 class   ExceptionObject;
  72 class   StateSplit;
  73 class     Invoke;
  74 class     NewInstance;
  75 class     NewValueTypeInstance;
  76 class     NewArray;
  77 class       NewTypeArray;
  78 class       NewObjectArray;
  79 class       NewMultiArray;
  80 class     WithField;
  81 class     DefaultValue;
  82 class     TypeCheck;
  83 class       CheckCast;
  84 class       InstanceOf;
  85 class     AccessMonitor;
  86 class       MonitorEnter;
  87 class       MonitorExit;
  88 class     Intrinsic;
  89 class     BlockBegin;
  90 class     BlockEnd;
  91 class       Goto;
  92 class       If;
  93 class       IfInstanceOf;
  94 class       Switch;
  95 class         TableSwitch;
  96 class         LookupSwitch;
  97 class       Return;
  98 class       Throw;
  99 class       Base;
 100 class   RoundFP;
 101 class   UnsafeOp;


 163  public:
 164   virtual void do_Phi            (Phi*             x) = 0;
 165   virtual void do_Local          (Local*           x) = 0;
 166   virtual void do_Constant       (Constant*        x) = 0;
 167   virtual void do_LoadField      (LoadField*       x) = 0;
 168   virtual void do_StoreField     (StoreField*      x) = 0;
 169   virtual void do_ArrayLength    (ArrayLength*     x) = 0;
 170   virtual void do_LoadIndexed    (LoadIndexed*     x) = 0;
 171   virtual void do_StoreIndexed   (StoreIndexed*    x) = 0;
 172   virtual void do_NegateOp       (NegateOp*        x) = 0;
 173   virtual void do_ArithmeticOp   (ArithmeticOp*    x) = 0;
 174   virtual void do_ShiftOp        (ShiftOp*         x) = 0;
 175   virtual void do_LogicOp        (LogicOp*         x) = 0;
 176   virtual void do_CompareOp      (CompareOp*       x) = 0;
 177   virtual void do_IfOp           (IfOp*            x) = 0;
 178   virtual void do_Convert        (Convert*         x) = 0;
 179   virtual void do_NullCheck      (NullCheck*       x) = 0;
 180   virtual void do_TypeCast       (TypeCast*        x) = 0;
 181   virtual void do_Invoke         (Invoke*          x) = 0;
 182   virtual void do_NewInstance    (NewInstance*     x) = 0;
 183   virtual void do_NewValueTypeInstance(NewValueTypeInstance* x) = 0;
 184   virtual void do_NewTypeArray   (NewTypeArray*    x) = 0;
 185   virtual void do_NewObjectArray (NewObjectArray*  x) = 0;
 186   virtual void do_NewMultiArray  (NewMultiArray*   x) = 0;
 187   virtual void do_WithField      (WithField*       x) = 0;
 188   virtual void do_DefaultValue   (DefaultValue*    x) = 0;
 189   virtual void do_CheckCast      (CheckCast*       x) = 0;
 190   virtual void do_InstanceOf     (InstanceOf*      x) = 0;
 191   virtual void do_MonitorEnter   (MonitorEnter*    x) = 0;
 192   virtual void do_MonitorExit    (MonitorExit*     x) = 0;
 193   virtual void do_Intrinsic      (Intrinsic*       x) = 0;
 194   virtual void do_BlockBegin     (BlockBegin*      x) = 0;
 195   virtual void do_Goto           (Goto*            x) = 0;
 196   virtual void do_If             (If*              x) = 0;
 197   virtual void do_IfInstanceOf   (IfInstanceOf*    x) = 0;
 198   virtual void do_TableSwitch    (TableSwitch*     x) = 0;
 199   virtual void do_LookupSwitch   (LookupSwitch*    x) = 0;
 200   virtual void do_Return         (Return*          x) = 0;
 201   virtual void do_Throw          (Throw*           x) = 0;
 202   virtual void do_Base           (Base*            x) = 0;
 203   virtual void do_OsrEntry       (OsrEntry*        x) = 0;
 204   virtual void do_ExceptionObject(ExceptionObject* x) = 0;
 205   virtual void do_RoundFP        (RoundFP*         x) = 0;
 206   virtual void do_UnsafeGetRaw   (UnsafeGetRaw*    x) = 0;
 207   virtual void do_UnsafePutRaw   (UnsafePutRaw*    x) = 0;
 208   virtual void do_UnsafeGetObject(UnsafeGetObject* x) = 0;


 346           _nonnull_state |= nth_bit(i);
 347         } else {
 348           _nonnull_state &= ~(nth_bit(i));
 349         }
 350       }
 351     }
 352   };
 353 
 354  public:
 355   void* operator new(size_t size) throw() {
 356     Compilation* c = Compilation::current();
 357     void* res = c->arena()->Amalloc(size);
 358     ((Instruction*)res)->_id = c->get_next_id();
 359     return res;
 360   }
 361 
 362   static const int no_bci = -99;
 363 
 364   enum InstructionFlag {
 365     NeedsNullCheckFlag = 0,
 366     NeverNullFlag,          // For "Q" signatures
 367     CanTrapFlag,
 368     DirectCompareFlag,
 369     IsEliminatedFlag,
 370     IsSafepointFlag,
 371     IsStaticFlag,
 372     IsStrictfpFlag,
 373     NeedsStoreCheckFlag,
 374     NeedsWriteBarrierFlag,
 375     PreservesStateFlag,
 376     TargetIsFinalFlag,
 377     TargetIsLoadedFlag,
 378     TargetIsStrictfpFlag,
 379     UnorderedIsTrueFlag,
 380     NeedsPatchingFlag,
 381     ThrowIncompatibleClassChangeErrorFlag,
 382     InvokeSpecialReceiverCheckFlag,
 383     ProfileMDOFlag,
 384     IsLinkedInBlockFlag,
 385     NeedsRangeCheckFlag,
 386     InWorkListFlag,


 441   int id() const                                 { return _id; }
 442 #ifndef PRODUCT
 443   bool has_printable_bci() const                 { return _printable_bci != -99; }
 444   int printable_bci() const                      { assert(has_printable_bci(), "_printable_bci should have been set"); return _printable_bci; }
 445   void set_printable_bci(int bci)                { _printable_bci = bci; }
 446 #endif
 447   int dominator_depth();
 448   int use_count() const                          { return _use_count; }
 449   int pin_state() const                          { return _pin_state; }
 450   bool is_pinned() const                         { return _pin_state != 0 || PinAllInstructions; }
 451   ValueType* type() const                        { return _type; }
 452   BlockBegin *block() const                      { return _block; }
 453   Instruction* prev();                           // use carefully, expensive operation
 454   Instruction* next() const                      { return _next; }
 455   bool has_subst() const                         { return _subst != NULL; }
 456   Instruction* subst()                           { return _subst == NULL ? this : _subst->subst(); }
 457   LIR_Opr operand() const                        { return _operand; }
 458 
 459   void set_needs_null_check(bool f)              { set_flag(NeedsNullCheckFlag, f); }
 460   bool needs_null_check() const                  { return check_flag(NeedsNullCheckFlag); }
 461   void set_never_null(bool f)                    { set_flag(NeverNullFlag, f); }
 462   bool is_never_null() const                     { return check_flag(NeverNullFlag); }
 463   bool is_linked() const                         { return check_flag(IsLinkedInBlockFlag); }
 464   bool can_be_linked()                           { return as_Local() == NULL && as_Phi() == NULL; }
 465 
 466   bool has_uses() const                          { return use_count() > 0; }
 467   ValueStack* state_before() const               { return _state_before; }
 468   ValueStack* exception_state() const            { return _exception_state; }
 469   virtual bool needs_exception_state() const     { return true; }
 470   XHandlers* exception_handlers() const          { return _exception_handlers; }
 471   ciKlass* as_loaded_klass_or_null() const;
 472 
 473   // withfield optimization
 474   virtual void set_escaped()                     { }
 475   virtual void set_local_index(int index)        { }
 476   virtual bool is_optimizable_for_withfield() const { return false; }
 477 
 478 
 479   // manipulation
 480   void pin(PinReason reason)                     { _pin_state |= reason; }
 481   void pin()                                     { _pin_state |= PinUnknown; }
 482   // DANGEROUS: only used by EliminateStores
 483   void unpin(PinReason reason)                   { assert((reason & PinUnknown) == 0, "can't unpin unknown state"); _pin_state &= ~reason; }
 484 
 485   Instruction* set_next(Instruction* next) {
 486     assert(next->has_printable_bci(), "_printable_bci should have been set");
 487     assert(next != NULL, "must not be NULL");
 488     assert(as_BlockEnd() == NULL, "BlockEnd instructions must have no next");
 489     assert(next->can_be_linked(), "shouldn't link these instructions into list");
 490 
 491     BlockBegin *block = this->block();
 492     next->_block = block;
 493 
 494     next->set_flag(Instruction::IsLinkedInBlockFlag, true);
 495     _next = next;
 496     return next;
 497   }


 502 #endif
 503     return set_next(next);
 504   }
 505 
 506   // when blocks are merged
 507   void fixup_block_pointers() {
 508     Instruction *cur = next()->next(); // next()'s block is set in set_next
 509     while (cur && cur->_block != block()) {
 510       cur->_block = block();
 511       cur = cur->next();
 512     }
 513   }
 514 
 515   Instruction *insert_after(Instruction *i) {
 516     Instruction* n = _next;
 517     set_next(i);
 518     i->set_next(n);
 519     return _next;
 520   }
 521 
 522   bool is_loaded_flattened_array() const;
 523   bool maybe_flattened_array();
 524   bool maybe_null_free_array();
 525 
 526   Instruction *insert_after_same_bci(Instruction *i) {
 527 #ifndef PRODUCT
 528     i->set_printable_bci(printable_bci());
 529 #endif
 530     return insert_after(i);
 531   }
 532 
 533   void set_subst(Instruction* subst)             {
 534     assert(subst == NULL ||
 535            type()->base() == subst->type()->base() ||
 536            subst->type()->base() == illegalType, "type can't change");
 537     _subst = subst;
 538   }
 539   void set_exception_handlers(XHandlers *xhandlers) { _exception_handlers = xhandlers; }
 540   void set_exception_state(ValueStack* s)        { check_state(s); _exception_state = s; }
 541   void set_state_before(ValueStack* s)           { check_state(s); _state_before = s; }
 542 
 543   // machine-specifics
 544   void set_operand(LIR_Opr operand)              { assert(operand != LIR_OprFact::illegalOpr, "operand must exist"); _operand = operand; }
 545   void clear_operand()                           { _operand = LIR_OprFact::illegalOpr; }


 553   virtual LoadField*        as_LoadField()       { return NULL; }
 554   virtual StoreField*       as_StoreField()      { return NULL; }
 555   virtual AccessArray*      as_AccessArray()     { return NULL; }
 556   virtual ArrayLength*      as_ArrayLength()     { return NULL; }
 557   virtual AccessIndexed*    as_AccessIndexed()   { return NULL; }
 558   virtual LoadIndexed*      as_LoadIndexed()     { return NULL; }
 559   virtual StoreIndexed*     as_StoreIndexed()    { return NULL; }
 560   virtual NegateOp*         as_NegateOp()        { return NULL; }
 561   virtual Op2*              as_Op2()             { return NULL; }
 562   virtual ArithmeticOp*     as_ArithmeticOp()    { return NULL; }
 563   virtual ShiftOp*          as_ShiftOp()         { return NULL; }
 564   virtual LogicOp*          as_LogicOp()         { return NULL; }
 565   virtual CompareOp*        as_CompareOp()       { return NULL; }
 566   virtual IfOp*             as_IfOp()            { return NULL; }
 567   virtual Convert*          as_Convert()         { return NULL; }
 568   virtual NullCheck*        as_NullCheck()       { return NULL; }
 569   virtual OsrEntry*         as_OsrEntry()        { return NULL; }
 570   virtual StateSplit*       as_StateSplit()      { return NULL; }
 571   virtual Invoke*           as_Invoke()          { return NULL; }
 572   virtual NewInstance*      as_NewInstance()     { return NULL; }
 573   virtual NewValueTypeInstance* as_NewValueTypeInstance() { return NULL; }
 574   virtual NewArray*         as_NewArray()        { return NULL; }
 575   virtual NewTypeArray*     as_NewTypeArray()    { return NULL; }
 576   virtual NewObjectArray*   as_NewObjectArray()  { return NULL; }
 577   virtual NewMultiArray*    as_NewMultiArray()   { return NULL; }
 578   virtual WithField*        as_WithField()       { return NULL; }
 579   virtual DefaultValue*     as_DefaultValue()    { return NULL; }
 580   virtual TypeCheck*        as_TypeCheck()       { return NULL; }
 581   virtual CheckCast*        as_CheckCast()       { return NULL; }
 582   virtual InstanceOf*       as_InstanceOf()      { return NULL; }
 583   virtual TypeCast*         as_TypeCast()        { return NULL; }
 584   virtual AccessMonitor*    as_AccessMonitor()   { return NULL; }
 585   virtual MonitorEnter*     as_MonitorEnter()    { return NULL; }
 586   virtual MonitorExit*      as_MonitorExit()     { return NULL; }
 587   virtual Intrinsic*        as_Intrinsic()       { return NULL; }
 588   virtual BlockBegin*       as_BlockBegin()      { return NULL; }
 589   virtual BlockEnd*         as_BlockEnd()        { return NULL; }
 590   virtual Goto*             as_Goto()            { return NULL; }
 591   virtual If*               as_If()              { return NULL; }
 592   virtual IfInstanceOf*     as_IfInstanceOf()    { return NULL; }
 593   virtual TableSwitch*      as_TableSwitch()     { return NULL; }
 594   virtual LookupSwitch*     as_LookupSwitch()    { return NULL; }
 595   virtual Return*           as_Return()          { return NULL; }
 596   virtual Throw*            as_Throw()           { return NULL; }
 597   virtual Base*             as_Base()            { return NULL; }
 598   virtual RoundFP*          as_RoundFP()         { return NULL; }
 599   virtual ExceptionObject*  as_ExceptionObject() { return NULL; }


 709   }
 710 
 711   bool is_illegal() const {
 712     return type()->is_illegal();
 713   }
 714 
 715   // generic
 716   virtual void input_values_do(ValueVisitor* f) {
 717   }
 718 };
 719 
 720 
 721 // A local is a placeholder for an incoming argument to a function call.
 722 LEAF(Local, Instruction)
 723  private:
 724   int      _java_index;                          // the local index within the method to which the local belongs
 725   bool     _is_receiver;                         // if local variable holds the receiver: "this" for non-static methods
 726   ciType*  _declared_type;
 727  public:
 728   // creation
 729   Local(ciType* declared, ValueType* type, int index, bool receiver, bool never_null)
 730     : Instruction(type)
 731     , _java_index(index)
 732     , _is_receiver(receiver)
 733     , _declared_type(declared)
 734   {
 735     set_never_null(never_null);
 736     NOT_PRODUCT(set_printable_bci(-1));
 737   }
 738 
 739   // accessors
 740   int java_index() const                         { return _java_index; }
 741   bool is_receiver() const                       { return _is_receiver; }
 742 
 743   virtual ciType* declared_type() const          { return _declared_type; }
 744 
 745   // generic
 746   virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
 747 };
 748 
 749 
 750 LEAF(Constant, Instruction)
 751  public:
 752   // creation
 753   Constant(ValueType* type):
 754       Instruction(type, NULL, /*type_is_constant*/ true)
 755   {


 835 
 836   // manipulation
 837 
 838   // Under certain circumstances, if a previous NullCheck instruction
 839   // proved the target object non-null, we can eliminate the explicit
 840   // null check and do an implicit one, simply specifying the debug
 841   // information from the NullCheck. This field should only be consulted
 842   // if needs_null_check() is true.
 843   void set_explicit_null_check(NullCheck* check) { _explicit_null_check = check; }
 844 
 845   // generic
 846   virtual bool can_trap() const                  { return needs_null_check() || needs_patching(); }
 847   virtual void input_values_do(ValueVisitor* f)   { f->visit(&_obj); }
 848 };
 849 
 850 
 851 LEAF(LoadField, AccessField)
 852  public:
 853   // creation
 854   LoadField(Value obj, int offset, ciField* field, bool is_static,
 855             ValueStack* state_before, bool needs_patching,
 856             ciValueKlass* value_klass = NULL, Value default_value = NULL )
 857   : AccessField(obj, offset, field, is_static, state_before, needs_patching)
 858   {}
 859 
 860   ciType* declared_type() const;
 861 
 862   // generic
 863   HASHING2(LoadField, !needs_patching() && !field()->is_volatile(), obj()->subst(), offset())  // cannot be eliminated if needs patching or if volatile
 864 };
 865 
 866 
 867 LEAF(StoreField, AccessField)
 868  private:
 869   Value _value;
 870 
 871  public:
 872   // creation
 873   StoreField(Value obj, int offset, ciField* field, Value value, bool is_static,
 874              ValueStack* state_before, bool needs_patching)
 875   : AccessField(obj, offset, field, is_static, state_before, needs_patching)
 876   , _value(value)


 955   }
 956 
 957   // accessors
 958   Value index() const                            { return _index; }
 959   Value length() const                           { return _length; }
 960   BasicType elt_type() const                     { return _elt_type; }
 961   bool mismatched() const                        { return _mismatched; }
 962 
 963   void clear_length()                            { _length = NULL; }
 964   // perform elimination of range checks involving constants
 965   bool compute_needs_range_check();
 966 
 967   // generic
 968   virtual void input_values_do(ValueVisitor* f)   { AccessArray::input_values_do(f); f->visit(&_index); if (_length != NULL) f->visit(&_length); }
 969 };
 970 
 971 
 972 LEAF(LoadIndexed, AccessIndexed)
 973  private:
 974   NullCheck*  _explicit_null_check;              // For explicit null check elimination
 975   NewValueTypeInstance* _vt;
 976 
 977  public:
 978   // creation
 979   LoadIndexed(Value array, Value index, Value length, BasicType elt_type, ValueStack* state_before, bool mismatched = false)
 980   : AccessIndexed(array, index, length, elt_type, state_before, mismatched)
 981   , _explicit_null_check(NULL), _vt(NULL) {}
 982 
 983   // accessors
 984   NullCheck* explicit_null_check() const         { return _explicit_null_check; }
 985 
 986   // setters
 987   // See LoadField::set_explicit_null_check for documentation
 988   void set_explicit_null_check(NullCheck* check) { _explicit_null_check = check; }
 989 
 990   ciType* exact_type() const;
 991   ciType* declared_type() const;
 992 
 993   NewValueTypeInstance* vt() { return _vt; }
 994   void set_vt(NewValueTypeInstance* vt) { _vt = vt; }
 995 
 996   // generic
 997   HASHING2(LoadIndexed, true, array()->subst(), index()->subst())
 998 };
 999 
1000 
1001 LEAF(StoreIndexed, AccessIndexed)
1002  private:
1003   Value       _value;
1004 
1005   ciMethod* _profiled_method;
1006   int       _profiled_bci;
1007   bool      _check_boolean;
1008 
1009  public:
1010   // creation
1011   StoreIndexed(Value array, Value index, Value length, BasicType elt_type, Value value, ValueStack* state_before,
1012                bool check_boolean, bool mismatched = false)
1013   : AccessIndexed(array, index, length, elt_type, state_before, mismatched)
1014   , _value(value), _profiled_method(NULL), _profiled_bci(0), _check_boolean(check_boolean)
1015   {
1016     set_flag(NeedsWriteBarrierFlag, (as_ValueType(elt_type)->is_object()));
1017     set_flag(NeedsStoreCheckFlag, (as_ValueType(elt_type)->is_object()));
1018     ASSERT_VALUES
1019     pin();
1020   }
1021 
1022   // accessors
1023   Value value() const                            { return _value; }
1024   bool needs_write_barrier() const               { return check_flag(NeedsWriteBarrierFlag); }
1025   bool needs_store_check() const                 { return check_flag(NeedsStoreCheckFlag); }
1026   bool check_boolean() const                     { return _check_boolean; }
1027   // Helpers for MethodData* profiling
1028   void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
1029   void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
1030   void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
1031   bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
1032   ciMethod* profiled_method() const                  { return _profiled_method;     }
1033   int       profiled_bci() const                     { return _profiled_bci;        }
1034   // Flattened array support
1035   bool is_exact_flattened_array_store() const;
1036   // generic
1037   virtual void input_values_do(ValueVisitor* f)   { AccessIndexed::input_values_do(f); f->visit(&_value); }
1038 };
1039 
1040 
1041 LEAF(NegateOp, Instruction)
1042  private:
1043   Value _x;
1044 
1045  public:
1046   // creation
1047   NegateOp(Value x) : Instruction(x->type()->base()), _x(x) {
1048     ASSERT_VALUES
1049   }
1050 
1051   // accessors
1052   Value x() const                                { return _x; }
1053 
1054   // generic
1055   virtual void input_values_do(ValueVisitor* f)   { f->visit(&_x); }


1130   HASHING3(Op2, true, op(), x()->subst(), y()->subst())
1131 };
1132 
1133 
1134 LEAF(CompareOp, Op2)
1135  public:
1136   // creation
1137   CompareOp(Bytecodes::Code op, Value x, Value y, ValueStack* state_before)
1138   : Op2(intType, op, x, y, state_before)
1139   {}
1140 
1141   // generic
1142   HASHING3(Op2, true, op(), x()->subst(), y()->subst())
1143 };
1144 
1145 
1146 LEAF(IfOp, Op2)
1147  private:
1148   Value _tval;
1149   Value _fval;
1150   bool _substitutability_check;
1151 
1152  public:
1153   // creation
1154   IfOp(Value x, Condition cond, Value y, Value tval, Value fval, ValueStack* state_before, bool substitutability_check)
1155   : Op2(tval->type()->meet(fval->type()), (Bytecodes::Code)cond, x, y)
1156   , _tval(tval)
1157   , _fval(fval)
1158   , _substitutability_check(substitutability_check)
1159   {
1160     ASSERT_VALUES
1161     assert(tval->type()->tag() == fval->type()->tag(), "types must match");
1162     set_state_before(state_before);
1163   }
1164 
1165   // accessors
1166   virtual bool is_commutative() const;
1167   Bytecodes::Code op() const                     { ShouldNotCallThis(); return Bytecodes::_illegal; }
1168   Condition cond() const                         { return (Condition)Op2::op(); }
1169   Value tval() const                             { return _tval; }
1170   Value fval() const                             { return _fval; }
1171   bool substitutability_check() const             { return _substitutability_check; }
1172   // generic
1173   virtual void input_values_do(ValueVisitor* f)   { Op2::input_values_do(f); f->visit(&_tval); f->visit(&_fval); }
1174 };
1175 
1176 
1177 LEAF(Convert, Instruction)
1178  private:
1179   Bytecodes::Code _op;
1180   Value           _value;
1181 
1182  public:
1183   // creation
1184   Convert(Bytecodes::Code op, Value value, ValueType* to_type) : Instruction(to_type), _op(op), _value(value) {
1185     ASSERT_VALUES
1186   }
1187 
1188   // accessors
1189   Bytecodes::Code op() const                     { return _op; }
1190   Value value() const                            { return _value; }
1191 


1271   void set_state(ValueStack* state)              { assert(_state == NULL, "overwriting existing state"); check_state(state); _state = state; }
1272 
1273   // generic
1274   virtual void input_values_do(ValueVisitor* f)   { /* no values */ }
1275   virtual void state_values_do(ValueVisitor* f);
1276 };
1277 
1278 
1279 LEAF(Invoke, StateSplit)
1280  private:
1281   Bytecodes::Code _code;
1282   Value           _recv;
1283   Values*         _args;
1284   BasicTypeList*  _signature;
1285   int             _vtable_index;
1286   ciMethod*       _target;
1287 
1288  public:
1289   // creation
1290   Invoke(Bytecodes::Code code, ValueType* result_type, Value recv, Values* args,
1291          int vtable_index, ciMethod* target, ValueStack* state_before, bool never_null);
1292 
1293   // accessors
1294   Bytecodes::Code code() const                   { return _code; }
1295   Value receiver() const                         { return _recv; }
1296   bool has_receiver() const                      { return receiver() != NULL; }
1297   int number_of_arguments() const                { return _args->length(); }
1298   Value argument_at(int i) const                 { return _args->at(i); }
1299   int vtable_index() const                       { return _vtable_index; }
1300   BasicTypeList* signature() const               { return _signature; }
1301   ciMethod* target() const                       { return _target; }
1302 
1303   ciType* declared_type() const;
1304 
1305   // Returns false if target is not loaded
1306   bool target_is_final() const                   { return check_flag(TargetIsFinalFlag); }
1307   bool target_is_loaded() const                  { return check_flag(TargetIsLoadedFlag); }
1308   // Returns false if target is not loaded
1309   bool target_is_strictfp() const                { return check_flag(TargetIsStrictfpFlag); }
1310 
1311   // JSR 292 support


1332 
1333  public:
1334   // creation
1335   NewInstance(ciInstanceKlass* klass, ValueStack* state_before, bool is_unresolved)
1336   : StateSplit(instanceType, state_before)
1337   , _klass(klass), _is_unresolved(is_unresolved)
1338   {}
1339 
1340   // accessors
1341   ciInstanceKlass* klass() const                 { return _klass; }
1342   bool is_unresolved() const                     { return _is_unresolved; }
1343 
1344   virtual bool needs_exception_state() const     { return false; }
1345 
1346   // generic
1347   virtual bool can_trap() const                  { return true; }
1348   ciType* exact_type() const;
1349   ciType* declared_type() const;
1350 };
1351 
1352 LEAF(NewValueTypeInstance, StateSplit)
1353   bool _is_unresolved;
1354   ciValueKlass* _klass;
1355   Value _depends_on;      // Link to instance on with withfield was called on
1356   bool _is_optimizable_for_withfield;
1357   int _first_local_index;
1358 public:
1359 
1360   // Default creation, always allocated for now
1361   NewValueTypeInstance(ciValueKlass* klass, ValueStack* state_before, bool is_unresolved, Value depends_on = NULL, bool from_default_value = false)
1362   : StateSplit(instanceType, state_before)
1363    , _is_unresolved(is_unresolved)
1364    , _klass(klass)
1365    , _is_optimizable_for_withfield(from_default_value)
1366    , _first_local_index(-1)
1367   {
1368     if (depends_on == NULL) {
1369       _depends_on = this;
1370     } else {
1371       _depends_on = depends_on;
1372     }
1373     set_never_null(true);
1374   }
1375 
1376   // accessors
1377   bool is_unresolved() const                     { return _is_unresolved; }
1378   Value depends_on();
1379 
1380   ciValueKlass* klass() const { return _klass; }
1381 
1382   virtual bool needs_exception_state() const     { return false; }
1383 
1384   // generic
1385   virtual bool can_trap() const                  { return true; }
1386   ciType* exact_type() const;
1387   ciType* declared_type() const;
1388 
1389   // Only done in LIR Generator -> map everything to object
1390   void set_to_object_type() { set_type(instanceType); }
1391 
1392   // withfield optimization
1393   virtual void set_escaped() {
1394     _is_optimizable_for_withfield = false;
1395   }
1396   virtual void set_local_index(int index) {
1397     if (_first_local_index != index) {
1398       if (_first_local_index == -1) {
1399         _first_local_index = index;
1400       } else {
1401         _is_optimizable_for_withfield = false;
1402       }
1403     }
1404   }
1405   virtual bool is_optimizable_for_withfield() const {  return _is_optimizable_for_withfield; }
1406 };
1407 
1408 BASE(NewArray, StateSplit)
1409  private:
1410   Value       _length;
1411 
1412  public:
1413   // creation
1414   NewArray(Value length, ValueStack* state_before)
1415   : StateSplit(objectType, state_before)
1416   , _length(length)
1417   {
1418     // Do not ASSERT_VALUES since length is NULL for NewMultiArray
1419   }
1420 
1421   // accessors
1422   Value length() const                           { return _length; }
1423 
1424   virtual bool needs_exception_state() const     { return false; }
1425 
1426   ciType* exact_type() const                     { return NULL; }


1438 
1439  public:
1440   // creation
1441   NewTypeArray(Value length, BasicType elt_type, ValueStack* state_before)
1442   : NewArray(length, state_before)
1443   , _elt_type(elt_type)
1444   {}
1445 
1446   // accessors
1447   BasicType elt_type() const                     { return _elt_type; }
1448   ciType* exact_type() const;
1449 };
1450 
1451 
1452 LEAF(NewObjectArray, NewArray)
1453  private:
1454   ciKlass* _klass;
1455 
1456  public:
1457   // creation
1458   NewObjectArray(ciKlass* klass, Value length, ValueStack* state_before, bool never_null)
1459   : NewArray(length, state_before), _klass(klass) {
1460     set_never_null(never_null);
1461   }
1462 
1463   // accessors
1464   ciKlass* klass() const                         { return _klass; }
1465   ciType* exact_type() const;
1466 };
1467 
1468 
1469 LEAF(NewMultiArray, NewArray)
1470  private:
1471   ciKlass* _klass;
1472   Values*  _dims;
1473 
1474  public:
1475   // creation
1476   NewMultiArray(ciKlass* klass, Values* dims, ValueStack* state_before) : NewArray(NULL, state_before), _klass(klass), _dims(dims) {
1477     ASSERT_VALUES
1478   }
1479 
1480   // accessors
1481   ciKlass* klass() const                         { return _klass; }
1482   Values* dims() const                           { return _dims; }
1483   int rank() const                               { return dims()->length(); }
1484 
1485   // generic
1486   virtual void input_values_do(ValueVisitor* f) {
1487     // NOTE: we do not call NewArray::input_values_do since "length"
1488     // is meaningless for a multi-dimensional array; passing the
1489     // zeroth element down to NewArray as its length is a bad idea
1490     // since there will be a copy in the "dims" array which doesn't
1491     // get updated, and the value must not be traversed twice. Was bug
1492     // - kbr 4/10/2001
1493     StateSplit::input_values_do(f);
1494     for (int i = 0; i < _dims->length(); i++) f->visit(_dims->adr_at(i));
1495   }
1496 
1497   ciType* exact_type() const;
1498 };
1499 
1500 LEAF(WithField, StateSplit)
1501  public:
1502   // creation
1503   WithField(ValueType* type, ValueStack* state_before)
1504   : StateSplit(type, state_before) {}
1505 };
1506 
1507 LEAF(DefaultValue, StateSplit)
1508  public:
1509   // creation
1510   DefaultValue(ValueType* type, ValueStack* state_before)
1511   : StateSplit(type, state_before) {}
1512 };
1513 
1514 BASE(TypeCheck, StateSplit)
1515  private:
1516   ciKlass*    _klass;
1517   Value       _obj;
1518 
1519   ciMethod* _profiled_method;
1520   int       _profiled_bci;
1521 
1522  public:
1523   // creation
1524   TypeCheck(ciKlass* klass, Value obj, ValueType* type, ValueStack* state_before)
1525   : StateSplit(type, state_before), _klass(klass), _obj(obj),
1526     _profiled_method(NULL), _profiled_bci(0) {
1527     ASSERT_VALUES
1528     set_direct_compare(false);
1529   }
1530 
1531   // accessors
1532   ciKlass* klass() const                         { return _klass; }


1537   // manipulation
1538   void set_direct_compare(bool flag)             { set_flag(DirectCompareFlag, flag); }
1539 
1540   // generic
1541   virtual bool can_trap() const                  { return true; }
1542   virtual void input_values_do(ValueVisitor* f)   { StateSplit::input_values_do(f); f->visit(&_obj); }
1543 
1544   // Helpers for MethodData* profiling
1545   void set_should_profile(bool value)                { set_flag(ProfileMDOFlag, value); }
1546   void set_profiled_method(ciMethod* method)         { _profiled_method = method;   }
1547   void set_profiled_bci(int bci)                     { _profiled_bci = bci;         }
1548   bool      should_profile() const                   { return check_flag(ProfileMDOFlag); }
1549   ciMethod* profiled_method() const                  { return _profiled_method;     }
1550   int       profiled_bci() const                     { return _profiled_bci;        }
1551 };
1552 
1553 
1554 LEAF(CheckCast, TypeCheck)
1555  public:
1556   // creation
1557   CheckCast(ciKlass* klass, Value obj, ValueStack* state_before, bool never_null = false)
1558   : TypeCheck(klass, obj, objectType, state_before) {
1559     set_never_null(never_null);
1560   }
1561 
1562   void set_incompatible_class_change_check() {
1563     set_flag(ThrowIncompatibleClassChangeErrorFlag, true);
1564   }
1565   bool is_incompatible_class_change_check() const {
1566     return check_flag(ThrowIncompatibleClassChangeErrorFlag);
1567   }
1568   void set_invokespecial_receiver_check() {
1569     set_flag(InvokeSpecialReceiverCheckFlag, true);
1570   }
1571   bool is_invokespecial_receiver_check() const {
1572     return check_flag(InvokeSpecialReceiverCheckFlag);
1573   }
1574 
1575   virtual bool needs_exception_state() const {
1576     return !is_invokespecial_receiver_check();
1577   }
1578 
1579   ciType* declared_type() const;
1580 };


1598   // creation
1599   AccessMonitor(Value obj, int monitor_no, ValueStack* state_before = NULL)
1600   : StateSplit(illegalType, state_before)
1601   , _obj(obj)
1602   , _monitor_no(monitor_no)
1603   {
1604     set_needs_null_check(true);
1605     ASSERT_VALUES
1606   }
1607 
1608   // accessors
1609   Value obj() const                              { return _obj; }
1610   int monitor_no() const                         { return _monitor_no; }
1611 
1612   // generic
1613   virtual void input_values_do(ValueVisitor* f)   { StateSplit::input_values_do(f); f->visit(&_obj); }
1614 };
1615 
1616 
1617 LEAF(MonitorEnter, AccessMonitor)
1618   bool _maybe_valuetype;
1619  public:
1620   // creation
1621   MonitorEnter(Value obj, int monitor_no, ValueStack* state_before, bool maybe_valuetype)
1622   : AccessMonitor(obj, monitor_no, state_before)
1623   , _maybe_valuetype(maybe_valuetype)
1624   {
1625     ASSERT_VALUES
1626   }
1627 
1628   // accessors
1629   bool maybe_valuetype() const                   { return _maybe_valuetype; }
1630 
1631   // generic
1632   virtual bool can_trap() const                  { return true; }
1633 };
1634 
1635 
1636 LEAF(MonitorExit, AccessMonitor)
1637  public:
1638   // creation
1639   MonitorExit(Value obj, int monitor_no)
1640   : AccessMonitor(obj, monitor_no, NULL)
1641   {
1642     ASSERT_VALUES
1643   }
1644 };
1645 
1646 
1647 LEAF(Intrinsic, StateSplit)
1648  private:
1649   vmIntrinsics::ID _id;
1650   Values*          _args;


2076   Condition cond() const                         { return _cond; }
2077   bool unordered_is_true() const                 { return check_flag(UnorderedIsTrueFlag); }
2078   Value y() const                                { return _y; }
2079 
2080   void always_fail()                             { _x = _y = NULL; }
2081 
2082   // generic
2083   virtual void input_values_do(ValueVisitor* f)  { StateSplit::input_values_do(f); f->visit(&_x); f->visit(&_y); }
2084   HASHING3(RangeCheckPredicate, true, x()->subst(), y()->subst(), cond())
2085 };
2086 
2087 LEAF(If, BlockEnd)
2088  private:
2089   Value       _x;
2090   Condition   _cond;
2091   Value       _y;
2092   ciMethod*   _profiled_method;
2093   int         _profiled_bci; // Canonicalizer may alter bci of If node
2094   bool        _swapped;      // Is the order reversed with respect to the original If in the
2095                              // bytecode stream?
2096   bool        _substitutability_check;
2097  public:
2098   // creation
2099   // unordered_is_true is valid for float/double compares only
2100   If(Value x, Condition cond, bool unordered_is_true, Value y, BlockBegin* tsux, BlockBegin* fsux, ValueStack* state_before, bool is_safepoint, bool substitutability_check=false)
2101     : BlockEnd(illegalType, state_before, is_safepoint)
2102   , _x(x)
2103   , _cond(cond)
2104   , _y(y)
2105   , _profiled_method(NULL)
2106   , _profiled_bci(0)
2107   , _swapped(false)
2108   , _substitutability_check(substitutability_check)
2109   {
2110     ASSERT_VALUES
2111     set_flag(UnorderedIsTrueFlag, unordered_is_true);
2112     assert(x->type()->tag() == y->type()->tag(), "types must match");
2113     BlockList* s = new BlockList(2);
2114     s->append(tsux);
2115     s->append(fsux);
2116     set_sux(s);
2117   }
2118 
2119   // accessors
2120   Value x() const                                { return _x; }
2121   Condition cond() const                         { return _cond; }
2122   bool unordered_is_true() const                 { return check_flag(UnorderedIsTrueFlag); }
2123   Value y() const                                { return _y; }
2124   BlockBegin* sux_for(bool is_true) const        { return sux_at(is_true ? 0 : 1); }
2125   BlockBegin* tsux() const                       { return sux_for(true); }
2126   BlockBegin* fsux() const                       { return sux_for(false); }
2127   BlockBegin* usux() const                       { return sux_for(unordered_is_true()); }
2128   bool should_profile() const                    { return check_flag(ProfileMDOFlag); }


2131   bool is_swapped() const                        { return _swapped; }
2132 
2133   // manipulation
2134   void swap_operands() {
2135     Value t = _x; _x = _y; _y = t;
2136     _cond = mirror(_cond);
2137   }
2138 
2139   void swap_sux() {
2140     assert(number_of_sux() == 2, "wrong number of successors");
2141     BlockList* s = sux();
2142     BlockBegin* t = s->at(0); s->at_put(0, s->at(1)); s->at_put(1, t);
2143     _cond = negate(_cond);
2144     set_flag(UnorderedIsTrueFlag, !check_flag(UnorderedIsTrueFlag));
2145   }
2146 
2147   void set_should_profile(bool value)             { set_flag(ProfileMDOFlag, value); }
2148   void set_profiled_method(ciMethod* method)      { _profiled_method = method; }
2149   void set_profiled_bci(int bci)                  { _profiled_bci = bci;       }
2150   void set_swapped(bool value)                    { _swapped = value;         }
2151   bool substitutability_check() const              { return _substitutability_check; }
2152   // generic
2153   virtual void input_values_do(ValueVisitor* f)   { BlockEnd::input_values_do(f); f->visit(&_x); f->visit(&_y); }
2154 };
2155 
2156 
2157 LEAF(IfInstanceOf, BlockEnd)
2158  private:
2159   ciKlass* _klass;
2160   Value    _obj;
2161   bool     _test_is_instance;                    // jump if instance
2162   int      _instanceof_bci;
2163 
2164  public:
2165   IfInstanceOf(ciKlass* klass, Value obj, bool test_is_instance, int instanceof_bci, BlockBegin* tsux, BlockBegin* fsux)
2166   : BlockEnd(illegalType, NULL, false) // temporary set to false
2167   , _klass(klass)
2168   , _obj(obj)
2169   , _test_is_instance(test_is_instance)
2170   , _instanceof_bci(instanceof_bci)
2171   {


< prev index next >