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

DecoderLocker is unused

XMLWordPrintable

    • b19

      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.

            coleenp Coleen Phillimore
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: