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

Add a version of CompiledIC_at that doesn't create a new RelocIterator

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b24

      Backports

        Description

        Creation of RelocIterators show up high in profiles of the remark phase, in the G1 Class Unloading project.

        There's a pattern in the nmethod/codecache code to create a RelocIterator and then materialize a CompiledIC:

            RelocIterator iter(this, low_boundary);
            while(iter.next()) {
              if (iter.type() == relocInfo::virtual_call_type) {
                CompiledIC *ic = CompiledIC_at(iter.reloc());

        CompiledIC_at is implemented as:
          new CompiledIC(call_site->code(), nativeCall_at(call_site->addr()));

        And one of the first thing CompiledIC::CompiledIC(const nmethod* nm, NativeCall* call) does is to create a new RelocIterator:
        ...
        address ic_call = call->instruction_address();
        ...
          RelocIterator iter(nm, ic_call, ic_call+1);
          bool ret = iter.next();
          assert(ret == true, "relocInfo must exist at this address");
          assert(iter.addr() == ic_call, "must find ic_call");

        I would like to propose that we pass down the RelocIterator that we already have, instead of creating a new.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                stefank Stefan Karlsson
                Reporter:
                stefank Stefan Karlsson
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: