hotspot/src/share/vm/code/nmethod.cpp
changeset 46438 b093c3f1ab3d
parent 46289 1904e7ec236e
child 46469 f0f38f5ac34f
equal deleted inserted replaced
46436:755e01cd0b9d 46438:b093c3f1ab3d
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
  1457   if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) {
  1457   if (_jmethod_id != NULL && JvmtiExport::should_post_compiled_method_unload()) {
  1458     assert(!unload_reported(), "already unloaded");
  1458     assert(!unload_reported(), "already unloaded");
  1459     JvmtiDeferredEvent event =
  1459     JvmtiDeferredEvent event =
  1460       JvmtiDeferredEvent::compiled_method_unload_event(this,
  1460       JvmtiDeferredEvent::compiled_method_unload_event(this,
  1461           _jmethod_id, insts_begin());
  1461           _jmethod_id, insts_begin());
  1462     if (SafepointSynchronize::is_at_safepoint()) {
  1462     MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
  1463       // Don't want to take the queueing lock. Add it as pending and
  1463     JvmtiDeferredEventQueue::enqueue(event);
  1464       // it will get enqueued later.
       
  1465       JvmtiDeferredEventQueue::add_pending_event(event);
       
  1466     } else {
       
  1467       MutexLockerEx ml(Service_lock, Mutex::_no_safepoint_check_flag);
       
  1468       JvmtiDeferredEventQueue::enqueue(event);
       
  1469     }
       
  1470   }
  1464   }
  1471 
  1465 
  1472   // The JVMTI CompiledMethodUnload event can be enabled or disabled at
  1466   // The JVMTI CompiledMethodUnload event can be enabled or disabled at
  1473   // any time. As the nmethod is being unloaded now we mark it has
  1467   // any time. As the nmethod is being unloaded now we mark it has
  1474   // having the unload event reported - this will ensure that we don't
  1468   // having the unload event reported - this will ensure that we don't