mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 23:04:50 +02:00
8200196: [Graal] implement Object.notify/notifyAll intrinsics
Reviewed-by: iveresov
This commit is contained in:
parent
716ac034c4
commit
054d2a2984
5 changed files with 36 additions and 0 deletions
|
@ -415,6 +415,34 @@ JRT_LEAF(void, JVMCIRuntime::monitorexit(JavaThread* thread, oopDesc* obj, Basic
|
|||
}
|
||||
JRT_END
|
||||
|
||||
// Object.notify() fast path, caller does slow path
|
||||
JRT_LEAF(jboolean, JVMCIRuntime::object_notify(JavaThread *thread, oopDesc* obj))
|
||||
|
||||
// Very few notify/notifyAll operations find any threads on the waitset, so
|
||||
// the dominant fast-path is to simply return.
|
||||
// Relatedly, it's critical that notify/notifyAll be fast in order to
|
||||
// reduce lock hold times.
|
||||
if (!SafepointSynchronize::is_synchronizing()) {
|
||||
if (ObjectSynchronizer::quick_notify(obj, thread, false)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false; // caller must perform slow path
|
||||
|
||||
JRT_END
|
||||
|
||||
// Object.notifyAll() fast path, caller does slow path
|
||||
JRT_LEAF(jboolean, JVMCIRuntime::object_notifyAll(JavaThread *thread, oopDesc* obj))
|
||||
|
||||
if (!SafepointSynchronize::is_synchronizing() ) {
|
||||
if (ObjectSynchronizer::quick_notify(obj, thread, true)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false; // caller must perform slow path
|
||||
|
||||
JRT_END
|
||||
|
||||
JRT_ENTRY(void, JVMCIRuntime::throw_and_post_jvmti_exception(JavaThread* thread, const char* exception, const char* message))
|
||||
TempNewSymbol symbol = SymbolTable::new_symbol(exception, CHECK);
|
||||
SharedRuntime::throw_and_post_jvmti_exception(thread, symbol, message);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue