hotspot/src/share/vm/opto/graphKit.cpp
changeset 11724 1500e51fdcbf
parent 11431 5ca3a19e559a
child 12623 09fcb0dc71ad
--- a/hotspot/src/share/vm/opto/graphKit.cpp	Tue Feb 07 11:33:15 2012 -0800
+++ b/hotspot/src/share/vm/opto/graphKit.cpp	Tue Feb 07 16:33:43 2012 -0800
@@ -1522,6 +1522,11 @@
                           const TypeOopPtr* val_type,
                           BasicType bt,
                           bool use_precise) {
+  // Transformation of a value which could be NULL pointer (CastPP #NULL)
+  // could be delayed during Parse (for example, in adjust_map_after_if()).
+  // Execute transformation here to avoid barrier generation in such case.
+  if (_gvn.type(val) == TypePtr::NULL_PTR)
+    val = _gvn.makecon(TypePtr::NULL_PTR);
 
   set_control(ctl);
   if (stopped()) return top(); // Dead path ?