Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8309777

[lworld+vector] Fix re-materialize crash for vector objects with un-vectorized multi-fields during deoptimization

XMLWordPrintable

      Vector API jtreg crashes with "-XX:+DeoptimizeALot" when running on hardwares that do not support the relative vector species.
      The log is:
      ```
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # Internal Error (/mnt/local/code/valhalla/src/hotspot/share/prims/vectorSupport.cpp:317), pid=2529357, tid=2529377
      # assert(loc_type == Location::oop || loc_type == Location::narrowoop) failed: expected 'oop'(2) or 'narrowoop'(9) types location but got: 3
      #
      # JRE version: OpenJDK Runtime Environment (21.0) (fastdebug build 21-internal-git-62ba7fc27)
      # Java VM: OpenJDK 64-Bit Server VM (fastdebug 21-internal-git-62ba7fc27, mixed mode, sharing, compressed oops, compressed class ptrs, g1 gc, linux-aarch64)
      # Problematic frame:
      # V [libjvm.so+0x1aed828] VectorSupport::allocate_vector_payload(InstanceKlass*, int, BasicType, frame*, RegisterMap*, ObjectValue*, JavaThread*)+0x41
      ```
      The cause is "VectorSupport::allocate_vector_payload" can only rematerialize the vector instance when the multi-field payload is vectorized. Otherwise, if the multi-fields in "VectorPayloadMF" is not vectorized, the fields should be reassigned one-by-one as usual primitive types. To realize this, two parts need to be modified:
      1. Pass the un-vectorized multi-fields on safepoint
      2. Special handling for multi-fields in klass when reassigning fields during deoptimization

            xgong Xiaohong Gong (Inactive)
            xgong Xiaohong Gong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: