Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalRuntime.hpp @ 16006:66a9286203a2
decoupled Graal runtime initialization and Graal compilation queue initialization
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 03 Jun 2014 11:51:27 +0200 |
parents | b35b1dc75ec0 |
children | d56a09df1a1f |
comparison
equal
deleted
inserted
replaced
16003:83433cf49019 | 16006:66a9286203a2 |
---|---|
29 #include "runtime/deoptimization.hpp" | 29 #include "runtime/deoptimization.hpp" |
30 | 30 |
31 class GraalRuntime: public CHeapObj<mtCompiler> { | 31 class GraalRuntime: public CHeapObj<mtCompiler> { |
32 private: | 32 private: |
33 | 33 |
34 static jobject _HotSpotGraalRuntime_instance; | |
34 static address _external_deopt_i2c_entry; | 35 static address _external_deopt_i2c_entry; |
35 | 36 |
36 /** | 37 /** |
37 * Reads the OptionValue object from a specified static field. | 38 * Reads the OptionValue object from a specified static field. |
38 * | 39 * |
75 * @throws InternalError if there was a problem setting the option's value | 76 * @throws InternalError if there was a problem setting the option's value |
76 */ | 77 */ |
77 static bool set_option(KlassHandle hotSpotOptionsClass, const char* name, int name_len, Handle name_handle, const char* value, TRAPS); | 78 static bool set_option(KlassHandle hotSpotOptionsClass, const char* name, int name_len, Handle name_handle, const char* value, TRAPS); |
78 | 79 |
79 /** | 80 /** |
81 * Java call to HotSpotOptions.setOption(String name, OptionValue<?> option, char spec, String stringValue, long primitiveValue) | |
82 */ | |
83 static void set_option_helper(KlassHandle hotSpotOptionsClass, Handle name, Handle option, jchar spec, Handle stringValue, jlong primitiveValue); | |
84 | |
85 /** | |
80 * Instantiates a service object, calls its default constructor and returns it. | 86 * Instantiates a service object, calls its default constructor and returns it. |
81 * | 87 * |
82 * @param name the name of a class implementing com.oracle.graal.api.runtime.Service | 88 * @param name the name of a class implementing com.oracle.graal.api.runtime.Service |
83 */ | 89 */ |
84 static Handle create_Service(const char* name, TRAPS); | 90 static Handle create_Service(const char* name, TRAPS); |
85 | 91 |
86 public: | 92 public: |
87 | 93 |
88 static void initialize_natives(JNIEnv *env, jclass c2vmClass); | 94 static void initialize_natives(JNIEnv *env, jclass c2vmClass); |
89 | 95 |
96 static bool is_HotSpotGraalRuntime_initialized() { return _HotSpotGraalRuntime_instance != NULL; } | |
97 | |
98 /** | |
99 * Gets the singleton HotSpotGraalRuntime instance, initializing it if necessary | |
100 */ | |
101 static Handle get_HotSpotGraalRuntime(); | |
102 | |
103 static jobject get_HotSpotGraalRuntime_jobject() { | |
104 get_HotSpotGraalRuntime(); | |
105 return _HotSpotGraalRuntime_instance; | |
106 } | |
107 | |
108 static void shutdown(); | |
109 | |
90 /** | 110 /** |
91 * Given an interface representing a Graal service (i.e. sub-interface of | 111 * Given an interface representing a Graal service (i.e. sub-interface of |
92 * com.oracle.graal.api.runtime.Service), gets an array of objects, one per | 112 * com.oracle.graal.api.runtime.Service), gets an array of objects, one per |
93 * known implementation of the service. | 113 * known implementation of the service. |
94 * | 114 * |
95 * The definition of this method is in graalRuntime.inline.hpp | 115 * The definition of this method is in graalRuntime.inline.hpp |
96 * which is generated by com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp. | 116 * which is generated by com.oracle.graal.hotspot.sourcegen.GenGraalRuntimeInlineHpp. |
97 */ | 117 */ |
98 static Handle get_service_impls(KlassHandle serviceKlass, TRAPS); | 118 static Handle get_service_impls(KlassHandle serviceKlass, TRAPS); |
119 | |
120 /** | |
121 * Aborts the VM due to an unexpected exception. | |
122 */ | |
123 static void abort_on_pending_exception(Handle exception, const char* message, bool dump_core = false); | |
124 | |
125 #define GUARANTEE_NO_PENDING_EXCEPTION(error_message) do { \ | |
126 if (HAS_PENDING_EXCEPTION) { \ | |
127 GraalRuntime::abort_on_pending_exception(PENDING_EXCEPTION, error_message); \ | |
128 } \ | |
129 } while (0); | |
130 | |
131 static Klass* load_required_class(Symbol* name); | |
99 | 132 |
100 static BufferBlob* initialize_buffer_blob(); | 133 static BufferBlob* initialize_buffer_blob(); |
101 | 134 |
102 static bool parse_arguments(KlassHandle hotSpotOptionsClass, TRAPS); | 135 static bool parse_arguments(KlassHandle hotSpotOptionsClass, TRAPS); |
103 | 136 |