JDK-8213399 : DecoderLocker is unused
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 12
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2018-11-06
  • Updated: 2019-08-15
  • Resolved: 2019-05-01
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 13
13 b19Fixed
Related Reports
Relates :  
Relates :  
Description
In decoder.hpp/cpp we have defined a DecoderLocker class that extends MutexLockerEx and handles the lock to use and whether to use safepoint checks:

DecoderLocker::DecoderLocker() :
  MutexLockerEx(DecoderLocker::is_first_error_thread() ?
                NULL : Decoder::shared_decoder_lock(),
                Mutex::_no_safepoint_check_flag) {
  _decoder = is_first_error_thread() ?
    Decoder::get_error_handler_instance() : Decoder::get_shared_instance();
  assert(_decoder != NULL, "null decoder");
}

but the actual methods still use MutexLockerEx e.g.

bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) {
  bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
  MutexLockerEx locker(error_handling_thread ? NULL : shared_decoder_lock(),
                       Mutex::_no_safepoint_check_flag);
  AbstractDecoder* decoder = error_handling_thread ?
    get_error_handler_instance(): get_shared_instance();
  assert(decoder != NULL, "null decoder");

  return decoder->decode(addr, buf, buflen, offset, modulepath, demangle);
}

We should either use DecoderLocker as intended, or else delete it.
Comments
Thanks for the history!
29-04-2019

Use of DecodeLocker were removed by JDK-8186349 [windows] Centralize dbghelp handling code
29-04-2019

It looks like DecodeLocker was added with this bug fix for JDK-8022335 .
29-04-2019