< prev index next >

src/hotspot/share/compiler/methodLiveness.cpp

Print this page
@@ -617,13 +617,16 @@
      case Bytecodes::_lookupswitch:
        // These bytecodes have no effect on the method's locals.
        break;
  
      case Bytecodes::_return:
-       if (instruction->method()->intrinsic_id() == vmIntrinsics::_Object_init) {
+       if (instruction->method()->intrinsic_id() == vmIntrinsics::_Object_init ||
+           (instruction->method()->is_object_constructor() && instruction->method()->holder()->is_inlinetype())) {
          // return from Object.init implicitly registers a finalizer
          // for the receiver if needed, so keep it alive.
+         // Value class constructors update the scalarized receiver. Keep it live so that
+         // we can find it after (chained) constructor calls and propagate updates to the caller.
          load_one(0);
        }
        break;
  
  
< prev index next >