11/*
2- * Copyright (c) 1997, 2017 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 1997, 2018 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
4141AbstractDecoder* Decoder::_shared_decoder = NULL ;
4242AbstractDecoder* Decoder::_error_handler_decoder = NULL ;
4343NullDecoder Decoder::_do_nothing_decoder;
44- Mutex* Decoder::_shared_decoder_lock = new Mutex(Mutex::native,
45- " SharedDecoderLock" ,
46- false ,
47- Monitor::_safepoint_check_never);
4844
4945AbstractDecoder* Decoder::get_shared_instance () {
50- assert (_shared_decoder_lock != NULL && _shared_decoder_lock->owned_by_self (),
51- " Require DecoderLock to enter" );
46+ assert (shared_decoder_lock ()->owned_by_self (), " Require DecoderLock to enter" );
5247
5348 if (_shared_decoder == NULL ) {
5449 _shared_decoder = create_decoder ();
@@ -89,21 +84,22 @@ inline bool DecoderLocker::is_first_error_thread() {
8984
9085DecoderLocker::DecoderLocker () :
9186 MutexLockerEx(DecoderLocker::is_first_error_thread() ?
92- NULL : Decoder::shared_decoder_lock(), true) {
87+ NULL : Decoder::shared_decoder_lock(),
88+ Mutex::_no_safepoint_check_flag) {
9389 _decoder = is_first_error_thread () ?
9490 Decoder::get_error_handler_instance () : Decoder::get_shared_instance ();
9591 assert (_decoder != NULL , " null decoder" );
9692}
9793
9894Mutex* Decoder::shared_decoder_lock () {
99- assert (_shared_decoder_lock != NULL , " Just check" );
100- return _shared_decoder_lock ;
95+ assert (SharedDecoder_lock != NULL , " Just check" );
96+ return SharedDecoder_lock ;
10197}
10298
10399bool Decoder::decode (address addr, char * buf, int buflen, int * offset, const char * modulepath, bool demangle) {
104- assert (_shared_decoder_lock != NULL , " Just check" );
105100 bool error_handling_thread = os::current_thread_id () == VMError::first_error_tid;
106- MutexLockerEx locker (error_handling_thread ? NULL : _shared_decoder_lock, true );
101+ MutexLockerEx locker (error_handling_thread ? NULL : shared_decoder_lock (),
102+ Mutex::_no_safepoint_check_flag);
107103 AbstractDecoder* decoder = error_handling_thread ?
108104 get_error_handler_instance (): get_shared_instance ();
109105 assert (decoder != NULL , " null decoder" );
@@ -112,9 +108,9 @@ bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const cha
112108}
113109
114110bool Decoder::decode (address addr, char * buf, int buflen, int * offset, const void * base) {
115- assert (_shared_decoder_lock != NULL , " Just check" );
116111 bool error_handling_thread = os::current_thread_id () == VMError::first_error_tid;
117- MutexLockerEx locker (error_handling_thread ? NULL : _shared_decoder_lock, true );
112+ MutexLockerEx locker (error_handling_thread ? NULL : shared_decoder_lock (),
113+ Mutex::_no_safepoint_check_flag);
118114 AbstractDecoder* decoder = error_handling_thread ?
119115 get_error_handler_instance (): get_shared_instance ();
120116 assert (decoder != NULL , " null decoder" );
@@ -124,9 +120,9 @@ bool Decoder::decode(address addr, char* buf, int buflen, int* offset, const voi
124120
125121
126122bool Decoder::demangle (const char * symbol, char * buf, int buflen) {
127- assert (_shared_decoder_lock != NULL , " Just check" );
128123 bool error_handling_thread = os::current_thread_id () == VMError::first_error_tid;
129- MutexLockerEx locker (error_handling_thread ? NULL : _shared_decoder_lock, true );
124+ MutexLockerEx locker (error_handling_thread ? NULL : shared_decoder_lock (),
125+ Mutex::_no_safepoint_check_flag);
130126 AbstractDecoder* decoder = error_handling_thread ?
131127 get_error_handler_instance (): get_shared_instance ();
132128 assert (decoder != NULL , " null decoder" );
0 commit comments