1073 } |
1073 } |
1074 } |
1074 } |
1075 } |
1075 } |
1076 |
1076 |
1077 |
1077 |
1078 // Check GC_locker::needs_gc and enter the runtime if it's true. This |
1078 // Check GCLocker::needs_gc and enter the runtime if it's true. This |
1079 // keeps a new JNI critical region from starting until a GC has been |
1079 // keeps a new JNI critical region from starting until a GC has been |
1080 // forced. Save down any oops in registers and describe them in an |
1080 // forced. Save down any oops in registers and describe them in an |
1081 // OopMap. |
1081 // OopMap. |
1082 static void check_needs_gc_for_critical_native(MacroAssembler* masm, |
1082 static void check_needs_gc_for_critical_native(MacroAssembler* masm, |
1083 int stack_slots, |
1083 int stack_slots, |
1255 // |
1255 // |
1256 // Critical native functions are a shorthand for the use of |
1256 // Critical native functions are a shorthand for the use of |
1257 // GetPrimtiveArrayCritical and disallow the use of any other JNI |
1257 // GetPrimtiveArrayCritical and disallow the use of any other JNI |
1258 // functions. The wrapper is expected to unpack the arguments before |
1258 // functions. The wrapper is expected to unpack the arguments before |
1259 // passing them to the callee and perform checks before and after the |
1259 // passing them to the callee and perform checks before and after the |
1260 // native call to ensure that they GC_locker |
1260 // native call to ensure that they GCLocker |
1261 // lock_critical/unlock_critical semantics are followed. Some other |
1261 // lock_critical/unlock_critical semantics are followed. Some other |
1262 // parts of JNI setup are skipped like the tear down of the JNI handle |
1262 // parts of JNI setup are skipped like the tear down of the JNI handle |
1263 // block and the check for pending exceptions it's impossible for them |
1263 // block and the check for pending exceptions it's impossible for them |
1264 // to be thrown. |
1264 // to be thrown. |
1265 // |
1265 // |
1266 // They are roughly structured like this: |
1266 // They are roughly structured like this: |
1267 // if (GC_locker::needs_gc()) |
1267 // if (GCLocker::needs_gc()) |
1268 // SharedRuntime::block_for_jni_critical(); |
1268 // SharedRuntime::block_for_jni_critical(); |
1269 // tranistion to thread_in_native |
1269 // tranistion to thread_in_native |
1270 // unpack arrray arguments and call native entry point |
1270 // unpack arrray arguments and call native entry point |
1271 // check for safepoint in progress |
1271 // check for safepoint in progress |
1272 // check if any thread suspend flags are set |
1272 // check if any thread suspend flags are set |