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

On x86 C1 emits two relocations for polls

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 9
    • 9
    • hotspot
    • b20
    • x86

    Description

      From Tom Rodriguez:

      If you run with -XX:+PrintRelocations you’ll see output kind of like this:

      relocInfo@0x0000000107d7b50e [type=10(poll) addr=0x0000000107d7b6ab offset=113]
              @0x0000000107d7b510: a400
      relocInfo@0x0000000107d7b510 [type=10(poll) addr=0x0000000107d7b6ab offset=0 format=1]
              @0x0000000107d7b512: b423

      The reason is that the shared add_debug_info_for branch calls relocate but so does the testl code for the poll itself. It’s not a big deal, though I think it may be what causes this fixup of the operand type in fix_relocation_after_move in relocInfo_x86.cpp:

      #ifdef _LP64
       if (!Assembler::is_polling_page_far()) {
         typedef Assembler::WhichOperand WhichOperand;
         WhichOperand which = (WhichOperand) format();
         // This format is imm but it is really disp32
         which = Assembler::disp32_operand;

      The shared reloc has the wrong format so it has to be fixed up.

      The extra relocate call is benign I think exception that it’s used in emit_opBranch:

       if (op->cond() == lir_cond_always) {
         if (op->info() != NULL) add_debug_info_for_branch(op->info());
         __ jmp (*(op->label()));

      I don’t know what’s going on here but I assume this should really be a safe point poll. Simply adding debug info doesn’t really do anything.

      Attachments

        Issue Links

          Activity

            People

              thartmann Tobias Hartmann
              roland Roland Westrelin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: