mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 03:24:38 +02:00
8199868: Support JNI critical functions in object pinning API
Pin/unpin incoming array arguments of critical native JNI call Reviewed-by: shade, adinn
This commit is contained in:
parent
9d25c65fda
commit
b71f3e7104
6 changed files with 493 additions and 2 deletions
|
@ -2863,6 +2863,22 @@ JRT_ENTRY_NO_ASYNC(void, SharedRuntime::block_for_jni_critical(JavaThread* threa
|
|||
GCLocker::unlock_critical(thread);
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(oopDesc*, SharedRuntime::pin_object(JavaThread* thread, oopDesc* obj))
|
||||
assert(Universe::heap()->supports_object_pinning(), "Why we are here?");
|
||||
assert(obj != NULL, "Should not be null");
|
||||
oop o(obj);
|
||||
o = Universe::heap()->pin_object(thread, o);
|
||||
assert(o != NULL, "Should not be null");
|
||||
return o;
|
||||
JRT_END
|
||||
|
||||
JRT_LEAF(void, SharedRuntime::unpin_object(JavaThread* thread, oopDesc* obj))
|
||||
assert(Universe::heap()->supports_object_pinning(), "Why we are here?");
|
||||
assert(obj != NULL, "Should not be null");
|
||||
oop o(obj);
|
||||
Universe::heap()->unpin_object(thread, o);
|
||||
JRT_END
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Java-Java calling convention
|
||||
// (what you use when Java calls Java)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue