@@ -1656,24 +1656,28 @@ bool nmethod::can_unload(BoolObjectClosure* is_alive, oop* root, bool unloading_
16561656// Transfer information from compilation to jvmti
16571657void nmethod::post_compiled_method_load_event () {
16581658
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 ();
16601664#ifndef USDT2
16611665 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 (),
16681672 insts_begin (), insts_size ());
16691673#else /* USDT2 */
16701674 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 (),
16771681 insts_begin (), insts_size ());
16781682#endif /* USDT2 */
16791683
0 commit comments