comparison src/share/vm/jvmci/jvmciRuntime.hpp @ 23379:24505bf61633

allow JVMCI compiler to change the compilation policy for a method (JDK-8152311)
author Doug Simon <doug.simon@oracle.com>
date Mon, 09 May 2016 16:08:16 +0200
parents 041534002323
children 0226d6bcb0d2
comparison
equal deleted inserted replaced
23378:b11f345e4af4 23379:24505bf61633
66 bool is_aborted() { return _abort; } 66 bool is_aborted() { return _abort; }
67 void set_filename(char* path) {_filename = path; _lineNo = 0;} 67 void set_filename(char* path) {_filename = path; _lineNo = 0;}
68 }; 68 };
69 69
70 class JVMCIRuntime: public AllStatic { 70 class JVMCIRuntime: public AllStatic {
71 public:
72 // Constants describing whether JVMCI wants to be able to adjust the compilation
73 // level selected for a method by the VM compilation policy and if so, based on
74 // what information about the method being schedule for compilation.
75 enum CompLevelAdjustment {
76 none = 0, // no adjustment
77 by_holder = 1, // adjust based on declaring class of method
78 by_full_signature = 2 // adjust based on declaring class, name and signature of method
79 };
80
71 private: 81 private:
72 static jobject _HotSpotJVMCIRuntime_instance; 82 static jobject _HotSpotJVMCIRuntime_instance;
73 static bool _HotSpotJVMCIRuntime_initialized; 83 static bool _HotSpotJVMCIRuntime_initialized;
74 84
75 static int _trivial_prefixes_count; 85 static int _trivial_prefixes_count;
76 static char** _trivial_prefixes; 86 static char** _trivial_prefixes;
77 87
88 static CompLevelAdjustment _comp_level_adjustment;
89
78 static bool _shutdown_called; 90 static bool _shutdown_called;
79 91
80 /** 92 /**
81 * Instantiates a service object, calls its default constructor and returns it. 93 * Instantiates a service object, calls its default constructor and returns it.
82 * 94 *
83 * @param name the name of a service provider class 95 * @param name the name of a service provider class
84 */ 96 */
85 static Handle create_Service(const char* name, TRAPS); 97 static Handle create_Service(const char* name, TRAPS);
98
99 static CompLevel adjust_comp_level_inner(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread);
86 100
87 public: 101 public:
88 /** 102 /**
89 * Parses *.properties files in jre/lib/jvmci/ and adds the properties to plist. 103 * Parses *.properties files in jre/lib/jvmci/ and adds the properties to plist.
90 */ 104 */
132 static bool shutdown_called() { 146 static bool shutdown_called() {
133 return _shutdown_called; 147 return _shutdown_called;
134 } 148 }
135 149
136 static bool treat_as_trivial(Method* method); 150 static bool treat_as_trivial(Method* method);
151
152 /**
153 * Lets JVMCI modify the compilation level currently selected for a method by
154 * the VM compilation policy.
155 *
156 * @param method the method being scheduled for compilation
157 * @param is_osr specifies if the compilation is an OSR compilation
158 * @param level the compilation level currently selected by the VM compilation policy
159 * @param thread the current thread
160 * @return the compilation level to use for the compilation
161 */
162 static CompLevel adjust_comp_level(methodHandle method, bool is_osr, CompLevel level, JavaThread* thread);
137 163
138 /** 164 /**
139 * Given an interface representing a JVMCI service, gets an array of objects, one per 165 * Given an interface representing a JVMCI service, gets an array of objects, one per
140 * known implementation of the service. 166 * known implementation of the service.
141 */ 167 */