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

    • Enhancement
    • Resolution: Fixed
    • P4
    • 9
    • 9
    • hotspot
    • 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

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

                Dates

                  Created:
                  Updated:
                  Resolved: