@@ -1656,24 +1656,28 @@ bool nmethod::can_unload(BoolObjectClosure* is_alive, oop* root, bool unloading_
1656
1656
// Transfer information from compilation to jvmti
1657
1657
void nmethod::post_compiled_method_load_event () {
1658
1658
1659
- Method* moop = method ();
1659
+ // This is a bad time for a safepoint. We don't want
1660
+ // this nmethod to get unloaded while we're queueing the event.
1661
+ No_Safepoint_Verifier nsv;
1662
+
1663
+ Method* m = method ();
1660
1664
#ifndef USDT2
1661
1665
HS_DTRACE_PROBE8 (hotspot, compiled__method__load,
1662
- moop ->klass_name ()->bytes (),
1663
- moop ->klass_name ()->utf8_length (),
1664
- moop ->name ()->bytes (),
1665
- moop ->name ()->utf8_length (),
1666
- moop ->signature ()->bytes (),
1667
- moop ->signature ()->utf8_length (),
1666
+ m ->klass_name ()->bytes (),
1667
+ m ->klass_name ()->utf8_length (),
1668
+ m ->name ()->bytes (),
1669
+ m ->name ()->utf8_length (),
1670
+ m ->signature ()->bytes (),
1671
+ m ->signature ()->utf8_length (),
1668
1672
insts_begin (), insts_size ());
1669
1673
#else /* USDT2 */
1670
1674
HOTSPOT_COMPILED_METHOD_LOAD (
1671
- (char *) moop ->klass_name ()->bytes (),
1672
- moop ->klass_name ()->utf8_length (),
1673
- (char *) moop ->name ()->bytes (),
1674
- moop ->name ()->utf8_length (),
1675
- (char *) moop ->signature ()->bytes (),
1676
- moop ->signature ()->utf8_length (),
1675
+ (char *) m ->klass_name ()->bytes (),
1676
+ m ->klass_name ()->utf8_length (),
1677
+ (char *) m ->name ()->bytes (),
1678
+ m ->name ()->utf8_length (),
1679
+ (char *) m ->signature ()->bytes (),
1680
+ m ->signature ()->utf8_length (),
1677
1681
insts_begin (), insts_size ());
1678
1682
#endif /* USDT2 */
1679
1683
0 commit comments