hotspot/src/share/vm/c1/c1_Optimizer.cpp
changeset 20702 bbe0fcde6e13
parent 17011 def8879c5b81
child 20709 034be898bf04
--- a/hotspot/src/share/vm/c1/c1_Optimizer.cpp	Wed Oct 09 11:05:17 2013 -0700
+++ b/hotspot/src/share/vm/c1/c1_Optimizer.cpp	Wed Oct 09 16:32:21 2013 +0200
@@ -657,6 +657,7 @@
   void handle_Intrinsic       (Intrinsic* x);
   void handle_ExceptionObject (ExceptionObject* x);
   void handle_Phi             (Phi* x);
+  void handle_ProfileCall     (ProfileCall* x);
 };
 
 
@@ -715,7 +716,8 @@
 void NullCheckVisitor::do_UnsafeGetAndSetObject(UnsafeGetAndSetObject* x) {}
 void NullCheckVisitor::do_UnsafePrefetchRead (UnsafePrefetchRead*  x) {}
 void NullCheckVisitor::do_UnsafePrefetchWrite(UnsafePrefetchWrite* x) {}
-void NullCheckVisitor::do_ProfileCall    (ProfileCall*     x) { nce()->clear_last_explicit_null_check(); }
+void NullCheckVisitor::do_ProfileCall    (ProfileCall*     x) { nce()->clear_last_explicit_null_check();
+                                                                nce()->handle_ProfileCall(x); }
 void NullCheckVisitor::do_ProfileInvoke  (ProfileInvoke*   x) {}
 void NullCheckVisitor::do_RuntimeCall    (RuntimeCall*     x) {}
 void NullCheckVisitor::do_MemBar         (MemBar*          x) {}
@@ -1134,6 +1136,11 @@
   }
 }
 
+void NullCheckEliminator::handle_ProfileCall(ProfileCall* x) {
+  for (int i = 0; i < x->nb_profiled_args(); i++) {
+    x->set_arg_needs_null_check(i, !set_contains(x->profiled_arg_at(i)));
+  }
+}
 
 void Optimizer::eliminate_null_checks() {
   ResourceMark rm;