39 ShenandoahReentrantLock* lock = ShenandoahNMethod::lock_for_nmethod(nm);
40 assert(lock != NULL, "Must be");
41 ShenandoahReentrantLocker locker(lock);
42
43 if (!is_armed(nm)) {
44 // Some other thread got here first and healed the oops
45 // and disarmed the nmethod.
46 return true;
47 }
48
49 MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, Thread::current());)
50
51 if (nm->is_unloading()) {
52 // We don't need to take the lock when unlinking nmethods from
53 // the Method, because it is only concurrently unlinked by
54 // the entry barrier, which acquires the per nmethod lock.
55 nm->unlink_from_method();
56
57 // We can end up calling nmethods that are unloading
58 // since we clear compiled ICs lazily. Returning false
59 // will re-resovle the call and update the compiled IC.
60 return false;
61 }
62
63 // Heal oops
64 ShenandoahNMethod::heal_nmethod(nm);
65
66 // CodeCache unloading support
67 nm->mark_as_maybe_on_stack();
68
69 // Disarm
70 ShenandoahNMethod::disarm_nmethod(nm);
71 return true;
72 }
|
39 ShenandoahReentrantLock* lock = ShenandoahNMethod::lock_for_nmethod(nm);
40 assert(lock != NULL, "Must be");
41 ShenandoahReentrantLocker locker(lock);
42
43 if (!is_armed(nm)) {
44 // Some other thread got here first and healed the oops
45 // and disarmed the nmethod.
46 return true;
47 }
48
49 MACOS_AARCH64_ONLY(ThreadWXEnable wx(WXWrite, Thread::current());)
50
51 if (nm->is_unloading()) {
52 // We don't need to take the lock when unlinking nmethods from
53 // the Method, because it is only concurrently unlinked by
54 // the entry barrier, which acquires the per nmethod lock.
55 nm->unlink_from_method();
56
57 // We can end up calling nmethods that are unloading
58 // since we clear compiled ICs lazily. Returning false
59 // will re-resolve the call and update the compiled IC.
60 return false;
61 }
62
63 // Heal oops
64 ShenandoahNMethod::heal_nmethod(nm);
65
66 // CodeCache unloading support
67 nm->mark_as_maybe_on_stack();
68
69 // Disarm
70 ShenandoahNMethod::disarm_nmethod(nm);
71 return true;
72 }
|