< prev index next >

src/hotspot/share/opto/type.cpp

Print this page

@@ -1979,13 +1979,13 @@
       uint pos = TypeFunc::Parms;
       field_array[pos] = TypePtr::BOTTOM;
       pos++;
       collect_value_fields(vk, field_array, pos);
     } else {
-      // Value type returns cannot be NULL
-      //field_array[TypeFunc::Parms] = get_const_type(return_type)->join_speculative(TypePtr::NOTNULL);
-      field_array[TypeFunc::Parms] = get_const_type(return_type);
+      // A NULL ValueType cannot be returned to compiled code. The 'areturn' bytecode
+      // handler will deoptimize its caller if it is about to return a NULL ValueType.
+      field_array[TypeFunc::Parms] = get_const_type(return_type)->join_speculative(TypePtr::NOTNULL);
     }
     break;
   case T_VOID:
     break;
   default:
< prev index next >