hotspot/src/share/vm/c1/c1_Optimizer.cpp
changeset 20702 bbe0fcde6e13
parent 17011 def8879c5b81
child 20709 034be898bf04
equal deleted inserted replaced
20701:ef9996662fd5 20702:bbe0fcde6e13
   655   void handle_NewArray        (NewArray* x);
   655   void handle_NewArray        (NewArray* x);
   656   void handle_AccessMonitor   (AccessMonitor* x);
   656   void handle_AccessMonitor   (AccessMonitor* x);
   657   void handle_Intrinsic       (Intrinsic* x);
   657   void handle_Intrinsic       (Intrinsic* x);
   658   void handle_ExceptionObject (ExceptionObject* x);
   658   void handle_ExceptionObject (ExceptionObject* x);
   659   void handle_Phi             (Phi* x);
   659   void handle_Phi             (Phi* x);
       
   660   void handle_ProfileCall     (ProfileCall* x);
   660 };
   661 };
   661 
   662 
   662 
   663 
   663 // NEEDS_CLEANUP
   664 // NEEDS_CLEANUP
   664 // There may be other instructions which need to clear the last
   665 // There may be other instructions which need to clear the last
   713 void NullCheckVisitor::do_UnsafeGetObject(UnsafeGetObject* x) {}
   714 void NullCheckVisitor::do_UnsafeGetObject(UnsafeGetObject* x) {}
   714 void NullCheckVisitor::do_UnsafePutObject(UnsafePutObject* x) {}
   715 void NullCheckVisitor::do_UnsafePutObject(UnsafePutObject* x) {}
   715 void NullCheckVisitor::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {}
   716 void NullCheckVisitor::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {}
   716 void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead*  x) {}
   717 void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead*  x) {}
   717 void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
   718 void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
   718 void NullCheckVisitor::do_ProfileCall    (ProfileCall*     x) { nce()->clear_last_explicit_null_check(); }
   719 void NullCheckVisitor::do_ProfileCall    (ProfileCall*     x) { nce()->clear_last_explicit_null_check();
       
   720                                                                 nce()->handle_ProfileCall(x); }
   719 void NullCheckVisitor::do_ProfileInvoke  (ProfileInvoke*   x) {}
   721 void NullCheckVisitor::do_ProfileInvoke  (ProfileInvoke*   x) {}
   720 void NullCheckVisitor::do_RuntimeCall    (RuntimeCall*     x) {}
   722 void NullCheckVisitor::do_RuntimeCall    (RuntimeCall*     x) {}
   721 void NullCheckVisitor::do_MemBar         (MemBar*          x) {}
   723 void NullCheckVisitor::do_MemBar         (MemBar*          x) {}
   722 void NullCheckVisitor::do_RangeCheckPredicate(RangeCheckPredicate* x) {}
   724 void NullCheckVisitor::do_RangeCheckPredicate(RangeCheckPredicate* x) {}
   723 #ifdef ASSERT
   725 #ifdef ASSERT
  1132   } else if (set_contains(x)) {
  1134   } else if (set_contains(x)) {
  1133     set_remove(x);
  1135     set_remove(x);
  1134   }
  1136   }
  1135 }
  1137 }
  1136 
  1138 
       
  1139 void NullCheckEliminator::handle_ProfileCall(ProfileCall* x) {
       
  1140   for (int i = 0; i < x->nb_profiled_args(); i++) {
       
  1141     x->set_arg_needs_null_check(i, !set_contains(x->profiled_arg_at(i)));
       
  1142   }
       
  1143 }
  1137 
  1144 
  1138 void Optimizer::eliminate_null_checks() {
  1145 void Optimizer::eliminate_null_checks() {
  1139   ResourceMark rm;
  1146   ResourceMark rm;
  1140 
  1147 
  1141   NullCheckEliminator nce(this);
  1148   NullCheckEliminator nce(this);