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

Compute allocation sizes of stubs and nmethods outside of lock protection

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 20
    • 20
    • hotspot
    • None
    • b04

      The creation functions of RuntimeStub, DeoptimizationBlob, UncommonTrapBlob, ExceptionBlob, SafepointBlob, and nmethod, compute allocation size under lock protection, but there is no risk of data race for this kind of calculation. They can be moved outside of the critical section in the same way it is done in 'BufferBlob::create', 'AdapterBlob::create' and
      'UpcallStub::create'.

      Change from:
      {
          MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
          ... CodeBlob::allocation_size(cb, sizeof(...));
          ...
      }


      to

      ... CodeBlob::allocation_size(cb, sizeof(...));
      {
          MutexLocker mu(CodeCache_lock, Mutex::_no_safepoint_check_flag);
          ...
      }

            yftsai Yi-Fan Tsai
            yftsai Yi-Fan Tsai
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: