--- a/src/hotspot/share/utilities/decoder.cpp Thu Nov 08 12:24:08 2018 +0100
+++ b/src/hotspot/share/utilities/decoder.cpp Thu Nov 08 07:42:08 2018 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -41,14 +41,9 @@
AbstractDecoder* Decoder::_shared_decoder = NULL;
AbstractDecoder* Decoder::_error_handler_decoder = NULL;
NullDecoder Decoder::_do_nothing_decoder;
-Mutex* Decoder::_shared_decoder_lock = new Mutex(Mutex::native,
- "SharedDecoderLock",
- false,
- Monitor::_safepoint_check_never);
AbstractDecoder* Decoder::get_shared_instance() {
- assert(_shared_decoder_lock != NULL && _shared_decoder_lock->owned_by_self(),
- "Require DecoderLock to enter");
+ assert(shared_decoder_lock()->owned_by_self(), "Require DecoderLock to enter");
if (_shared_decoder == NULL) {
_shared_decoder = create_decoder();
@@ -89,21 +84,22 @@
DecoderLocker::DecoderLocker() :
MutexLockerEx(DecoderLocker::is_first_error_thread() ?
- NULL : Decoder::shared_decoder_lock(), true) {
+ 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");
}
Mutex* Decoder::shared_decoder_lock() {
- assert(_shared_decoder_lock != NULL, "Just check");
- return _shared_decoder_lock;
+ assert(SharedDecoder_lock != NULL, "Just check");
+ return SharedDecoder_lock;
}
bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const char* modulepath, bool demangle) {
- assert(_shared_decoder_lock != NULL, "Just check");
bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
- MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true);
+ 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");
@@ -112,9 +108,9 @@
}
bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const void* base) {
- assert(_shared_decoder_lock != NULL, "Just check");
bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
- MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true);
+ 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");
@@ -124,9 +120,9 @@
bool Decoder::demangle(const char* symbol, char* buf, int buflen) {
- assert(_shared_decoder_lock != NULL, "Just check");
bool error_handling_thread = os::current_thread_id() == VMError::first_error_tid;
- MutexLockerEx locker(error_handling_thread ? NULL : _shared_decoder_lock, true);
+ 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");