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

[lworld][c1] arraycopy_valuetype_check needs to do null check first

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: repo-valhalla
    • Fix Version/s: repo-valhalla
    • Component/s: hotspot
    • Labels:

      Description

      http://hg.openjdk.java.net/valhalla/valhalla/file/001a0187778a/src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp#l3201

      void LIR_Assembler::arraycopy_valuetype_check(Register obj, Register tmp, CodeStub* slow_path, bool is_dest) {
        __ load_storage_props(tmp, obj);
        if (is_dest) {
          // We also take slow path if it's a null_free destination array, just in case the source array
          // contains NULLs.
          __ testb(tmp, ArrayStorageProperties::flattened_value | ArrayStorageProperties::null_free_value);
        } else {
          __ testb(tmp, ArrayStorageProperties::flattened_value);
        }
        __ jcc(Assembler::notEqual, *slow_path->entry());
      }

      We need to check if <obj> is NULL first before loading the storage properties from it.

        Attachments

          Activity

            People

            • Assignee:
              iklam Ioi Lam
              Reporter:
              iklam Ioi Lam
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: