< prev index next >

src/share/vm/prims/jni.cpp

Print this page




  67 #include "runtime/interfaceSupport.hpp"
  68 #include "runtime/java.hpp"
  69 #include "runtime/javaCalls.hpp"
  70 #include "runtime/jfieldIDWorkaround.hpp"
  71 #include "runtime/orderAccess.inline.hpp"
  72 #include "runtime/reflection.hpp"
  73 #include "runtime/sharedRuntime.hpp"
  74 #include "runtime/signature.hpp"
  75 #include "runtime/thread.inline.hpp"
  76 #include "runtime/vm_operations.hpp"
  77 #include "services/memTracker.hpp"
  78 #include "services/runtimeService.hpp"
  79 #include "trace/traceMacros.hpp"
  80 #include "trace/tracing.hpp"
  81 #include "utilities/defaultStream.hpp"
  82 #include "utilities/dtrace.hpp"
  83 #include "utilities/events.hpp"
  84 #include "utilities/histogram.hpp"
  85 #include "utilities/internalVMTests.hpp"
  86 #include "utilities/macros.hpp"

  87 #if INCLUDE_ALL_GCS
  88 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  89 #endif // INCLUDE_ALL_GCS
  90 #if INCLUDE_JVMCI
  91 #include "jvmci/jvmciCompiler.hpp"
  92 #include "jvmci/jvmciRuntime.hpp"
  93 #endif
  94 
  95 static jint CurrentVersion = JNI_VERSION_9;
  96 
  97 #ifdef _WIN32
  98 extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
  99 #endif
 100 
 101 // The DT_RETURN_MARK macros create a scoped object to fire the dtrace
 102 // '-return' probe regardless of the return path is taken out of the function.
 103 // Methods that have multiple return paths use this to avoid having to
 104 // instrument each return path.  Methods that use CHECK or THROW must use this
 105 // since those macros can cause an immedate uninstrumented return.
 106 //


3966     RuntimeService::record_application_start();
3967 
3968     // Notify JVMTI
3969     if (JvmtiExport::should_post_thread_life()) {
3970        JvmtiExport::post_thread_start(thread);
3971     }
3972 
3973     EventThreadStart event;
3974     if (event.should_commit()) {
3975       event.set_thread(THREAD_TRACE_ID(thread));
3976       event.commit();
3977     }
3978 
3979 #ifndef PRODUCT
3980     // Check if we should compile all classes on bootclasspath
3981     if (CompileTheWorld) ClassLoader::compile_the_world();
3982     if (ReplayCompiles) ciReplay::replay(thread);
3983 
3984     // Some platforms (like Win*) need a wrapper around these test
3985     // functions in order to properly handle error conditions.
3986     test_error_handler();
3987     if (ExecuteInternalVMTests) {
3988       InternalVMTests::run();
3989     }
3990 #endif
3991 
3992     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
3993     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
3994   } else {
3995     // If create_vm exits because of a pending exception, exit with that
3996     // exception.  In the future when we figure out how to reclaim memory,
3997     // we may be able to exit with JNI_ERR and allow the calling application
3998     // to continue.
3999     if (Universe::is_fully_initialized()) {
4000       // otherwise no pending exception possible - VM will already have aborted
4001       JavaThread* THREAD = JavaThread::current();
4002       if (HAS_PENDING_EXCEPTION) {
4003         HandleMark hm;
4004         vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
4005       }
4006     }




  67 #include "runtime/interfaceSupport.hpp"
  68 #include "runtime/java.hpp"
  69 #include "runtime/javaCalls.hpp"
  70 #include "runtime/jfieldIDWorkaround.hpp"
  71 #include "runtime/orderAccess.inline.hpp"
  72 #include "runtime/reflection.hpp"
  73 #include "runtime/sharedRuntime.hpp"
  74 #include "runtime/signature.hpp"
  75 #include "runtime/thread.inline.hpp"
  76 #include "runtime/vm_operations.hpp"
  77 #include "services/memTracker.hpp"
  78 #include "services/runtimeService.hpp"
  79 #include "trace/traceMacros.hpp"
  80 #include "trace/tracing.hpp"
  81 #include "utilities/defaultStream.hpp"
  82 #include "utilities/dtrace.hpp"
  83 #include "utilities/events.hpp"
  84 #include "utilities/histogram.hpp"
  85 #include "utilities/internalVMTests.hpp"
  86 #include "utilities/macros.hpp"
  87 #include "utilities/vmError.hpp"
  88 #if INCLUDE_ALL_GCS
  89 #include "gc/g1/g1SATBCardTableModRefBS.hpp"
  90 #endif // INCLUDE_ALL_GCS
  91 #if INCLUDE_JVMCI
  92 #include "jvmci/jvmciCompiler.hpp"
  93 #include "jvmci/jvmciRuntime.hpp"
  94 #endif
  95 
  96 static jint CurrentVersion = JNI_VERSION_9;
  97 
  98 #ifdef _WIN32
  99 extern LONG WINAPI topLevelExceptionFilter(_EXCEPTION_POINTERS* );
 100 #endif
 101 
 102 // The DT_RETURN_MARK macros create a scoped object to fire the dtrace
 103 // '-return' probe regardless of the return path is taken out of the function.
 104 // Methods that have multiple return paths use this to avoid having to
 105 // instrument each return path.  Methods that use CHECK or THROW must use this
 106 // since those macros can cause an immedate uninstrumented return.
 107 //


3967     RuntimeService::record_application_start();
3968 
3969     // Notify JVMTI
3970     if (JvmtiExport::should_post_thread_life()) {
3971        JvmtiExport::post_thread_start(thread);
3972     }
3973 
3974     EventThreadStart event;
3975     if (event.should_commit()) {
3976       event.set_thread(THREAD_TRACE_ID(thread));
3977       event.commit();
3978     }
3979 
3980 #ifndef PRODUCT
3981     // Check if we should compile all classes on bootclasspath
3982     if (CompileTheWorld) ClassLoader::compile_the_world();
3983     if (ReplayCompiles) ciReplay::replay(thread);
3984 
3985     // Some platforms (like Win*) need a wrapper around these test
3986     // functions in order to properly handle error conditions.
3987     VMError::test_error_handler();
3988     if (ExecuteInternalVMTests) {
3989       InternalVMTests::run();
3990     }
3991 #endif
3992 
3993     // Since this is not a JVM_ENTRY we have to set the thread state manually before leaving.
3994     ThreadStateTransition::transition_and_fence(thread, _thread_in_vm, _thread_in_native);
3995   } else {
3996     // If create_vm exits because of a pending exception, exit with that
3997     // exception.  In the future when we figure out how to reclaim memory,
3998     // we may be able to exit with JNI_ERR and allow the calling application
3999     // to continue.
4000     if (Universe::is_fully_initialized()) {
4001       // otherwise no pending exception possible - VM will already have aborted
4002       JavaThread* THREAD = JavaThread::current();
4003       if (HAS_PENDING_EXCEPTION) {
4004         HandleMark hm;
4005         vm_exit_during_initialization(Handle(THREAD, PENDING_EXCEPTION));
4006       }
4007     }


< prev index next >