Mercurial > hg > truffle
diff src/share/vm/graal/graalRuntime.hpp @ 19920:7366593c0610
Make the native initialization path for Graal more robust
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Mon, 16 Mar 2015 17:37:32 -0700 |
parents | 9c2396ef02db |
children | 923c37b10fb4 1ab7802d35c9 |
line wrap: on
line diff
--- a/src/share/vm/graal/graalRuntime.hpp Mon Mar 16 16:38:17 2015 -0700 +++ b/src/share/vm/graal/graalRuntime.hpp Mon Mar 16 17:37:32 2015 -0700 @@ -138,13 +138,29 @@ /** * Gets the singleton HotSpotGraalRuntime instance, initializing it if necessary */ - static Handle get_HotSpotGraalRuntime(); + static Handle get_HotSpotGraalRuntime() { + initialize_Graal(); + return Handle(JNIHandles::resolve_non_null(_HotSpotGraalRuntime_instance)); + } static jobject get_HotSpotGraalRuntime_jobject() { - get_HotSpotGraalRuntime(); + initialize_Graal(); + assert(_HotSpotGraalRuntime_initialized, "must be"); return _HotSpotGraalRuntime_instance; } + static Handle callInitializer(const char* className, const char* methodName, const char* returnType); + + /** + * Trigger initialization of HotSpotGraalRuntime through Graal.runtime() + */ + static void initialize_Graal(); + + /** + * Explicitly initialize HotSpotGraalRuntime itself + */ + static void initialize_HotSpotGraalRuntime(); + static void shutdown(); static bool shutdown_called() {