251 |
251 |
252 WB_ENTRY(jint, WB_GetCompileQueuesSize(JNIEnv* env, jobject o)) |
252 WB_ENTRY(jint, WB_GetCompileQueuesSize(JNIEnv* env, jobject o)) |
253 return CompileBroker::queue_size(CompLevel_full_optimization) /* C2 */ + |
253 return CompileBroker::queue_size(CompLevel_full_optimization) /* C2 */ + |
254 CompileBroker::queue_size(CompLevel_full_profile) /* C1 */; |
254 CompileBroker::queue_size(CompLevel_full_profile) /* C1 */; |
255 WB_END |
255 WB_END |
|
256 |
|
257 WB_ENTRY(jboolean, WB_IsInStringTable(JNIEnv* env, jobject o, jstring javaString)) |
|
258 ResourceMark rm(THREAD); |
|
259 int len; |
|
260 jchar* name = java_lang_String::as_unicode_string(JNIHandles::resolve(javaString), len); |
|
261 oop found_string = StringTable::the_table()->lookup(name, len); |
|
262 if (found_string == NULL) { |
|
263 return false; |
|
264 } |
|
265 return true; |
|
266 WB_END |
|
267 |
|
268 |
|
269 WB_ENTRY(void, WB_FullGC(JNIEnv* env, jobject o)) |
|
270 Universe::heap()->collector_policy()->set_should_clear_all_soft_refs(true); |
|
271 Universe::heap()->collect(GCCause::_last_ditch_collection); |
|
272 WB_END |
|
273 |
256 |
274 |
257 //Some convenience methods to deal with objects from java |
275 //Some convenience methods to deal with objects from java |
258 int WhiteBox::offset_for_field(const char* field_name, oop object, |
276 int WhiteBox::offset_for_field(const char* field_name, oop object, |
259 Symbol* signature_symbol) { |
277 Symbol* signature_symbol) { |
260 assert(field_name != NULL && strlen(field_name) > 0, "Field name not valid"); |
278 assert(field_name != NULL && strlen(field_name) > 0, "Field name not valid"); |
341 CC"(Ljava/lang/reflect/Method;Z)Z", (void*)&WB_SetDontInlineMethod}, |
359 CC"(Ljava/lang/reflect/Method;Z)Z", (void*)&WB_SetDontInlineMethod}, |
342 {CC"getMethodCompilationLevel", |
360 {CC"getMethodCompilationLevel", |
343 CC"(Ljava/lang/reflect/Method;)I", (void*)&WB_GetMethodCompilationLevel}, |
361 CC"(Ljava/lang/reflect/Method;)I", (void*)&WB_GetMethodCompilationLevel}, |
344 {CC"getCompileQueuesSize", |
362 {CC"getCompileQueuesSize", |
345 CC"()I", (void*)&WB_GetCompileQueuesSize}, |
363 CC"()I", (void*)&WB_GetCompileQueuesSize}, |
|
364 {CC"isInStringTable", CC"(Ljava/lang/String;)Z", (void*)&WB_IsInStringTable }, |
|
365 {CC"fullGC", CC"()V", (void*)&WB_FullGC }, |
346 }; |
366 }; |
347 |
367 |
348 #undef CC |
368 #undef CC |
349 |
369 |
350 JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass)) |
370 JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass)) |