391 Thread* THREAD = thread; \ |
391 Thread* THREAD = thread; \ |
392 os::verify_stack_alignment(); \ |
392 os::verify_stack_alignment(); \ |
393 /* begin of body */ |
393 /* begin of body */ |
394 |
394 |
395 |
395 |
396 // QUICK_ENTRY routines behave like ENTRY but without a handle mark |
|
397 |
|
398 #define VM_QUICK_ENTRY_BASE(result_type, header, thread) \ |
|
399 TRACE_CALL(result_type, header) \ |
|
400 debug_only(NoHandleMark __hm;) \ |
|
401 Thread* THREAD = thread; \ |
|
402 os::verify_stack_alignment(); \ |
|
403 /* begin of body */ |
|
404 |
|
405 |
|
406 #define JRT_ENTRY(result_type, header) \ |
396 #define JRT_ENTRY(result_type, header) \ |
407 result_type header { \ |
397 result_type header { \ |
408 ThreadInVMfromJava __tiv(thread); \ |
398 ThreadInVMfromJava __tiv(thread); \ |
409 VM_ENTRY_BASE(result_type, header, thread) \ |
399 VM_ENTRY_BASE(result_type, header, thread) \ |
410 debug_only(VMEntryWrapper __vew;) |
400 debug_only(VMEntryWrapper __vew;) |
472 ThreadInVMfromNative __tiv(thread); \ |
462 ThreadInVMfromNative __tiv(thread); \ |
473 debug_only(VMNativeEntryWrapper __vew;) \ |
463 debug_only(VMNativeEntryWrapper __vew;) \ |
474 VM_ENTRY_BASE(result_type, header, thread) |
464 VM_ENTRY_BASE(result_type, header, thread) |
475 |
465 |
476 |
466 |
477 // Ensure that the VMNativeEntryWrapper constructor, which can cause |
|
478 // a GC, is called outside the NoHandleMark (set via VM_QUICK_ENTRY_BASE). |
|
479 #define JNI_QUICK_ENTRY(result_type, header) \ |
|
480 extern "C" { \ |
|
481 result_type JNICALL header { \ |
|
482 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ |
|
483 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \ |
|
484 ThreadInVMfromNative __tiv(thread); \ |
|
485 debug_only(VMNativeEntryWrapper __vew;) \ |
|
486 VM_QUICK_ENTRY_BASE(result_type, header, thread) |
|
487 |
|
488 |
|
489 #define JNI_LEAF(result_type, header) \ |
467 #define JNI_LEAF(result_type, header) \ |
490 extern "C" { \ |
468 extern "C" { \ |
491 result_type JNICALL header { \ |
469 result_type JNICALL header { \ |
492 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ |
470 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ |
493 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \ |
471 assert( !VerifyJNIEnvThread || (thread == Thread::current()), "JNIEnv is only valid in same thread"); \ |
517 ThreadInVMfromNative __tiv(thread); \ |
495 ThreadInVMfromNative __tiv(thread); \ |
518 debug_only(VMNativeEntryWrapper __vew;) \ |
496 debug_only(VMNativeEntryWrapper __vew;) \ |
519 VM_ENTRY_BASE(result_type, header, thread) |
497 VM_ENTRY_BASE(result_type, header, thread) |
520 |
498 |
521 |
499 |
522 #define JVM_QUICK_ENTRY(result_type, header) \ |
|
523 extern "C" { \ |
|
524 result_type JNICALL header { \ |
|
525 JavaThread* thread=JavaThread::thread_from_jni_environment(env); \ |
|
526 ThreadInVMfromNative __tiv(thread); \ |
|
527 debug_only(VMNativeEntryWrapper __vew;) \ |
|
528 VM_QUICK_ENTRY_BASE(result_type, header, thread) |
|
529 |
|
530 |
|
531 #define JVM_LEAF(result_type, header) \ |
500 #define JVM_LEAF(result_type, header) \ |
532 extern "C" { \ |
501 extern "C" { \ |
533 result_type JNICALL header { \ |
502 result_type JNICALL header { \ |
534 VM_Exit::block_if_vm_exited(); \ |
503 VM_Exit::block_if_vm_exited(); \ |
535 VM_LEAF_BASE(result_type, header) |
504 VM_LEAF_BASE(result_type, header) |