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:
Zhengyu Gu 2018-07-31 13:12:06 -04:00
parent 9d25c65fda
commit b71f3e7104
6 changed files with 493 additions and 2 deletions

View file

@ -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)