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

Alignment of static call stubs is inconsistent

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • P3
    • Resolution: Unresolved
    • 11, 17, 19, 20
    • tbd
    • hotspot

    Description

      When we emit static call stubs via C1, we carefully align the instructions of the static call stub in the following way:

        __ align(BytesPerWord, __ offset() + NativeMovConstReg::instruction_size + NativeCall::displacement_offset);
        __ relocate(static_stub_Relocation::spec(call_pc));
        __ mov_metadata(rbx, (Metadata*)NULL);
        // must be set to -1 at code generation time
        assert(((__ offset() + 1) % BytesPerWord) == 0, "must be aligned");
        // On 64bit this will die since it will take a movq & jmp, must be only a jmp
        __ jump(RuntimeAddress(__ pc()));

      However, when we emit the static call stubs from C2, we go through a different path in CompiledStaticCall::emit_to_interp_stub, where the instructions are not explicitly aligned in the same way.

      It would appear that the C2 static call stubs are not aligned appropriately, which might lead to strange behaviour when it is concurrently updated with cross modifying code, partially during resolution, and partially through concurrent class unloading.

      Attachments

        Issue Links

          Activity

            People

              dlong Dean Long
              eosterlund Erik Ă–sterlund
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated: