src/share/vm/prims/whitebox.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/share/vm/prims/whitebox.cpp

src/share/vm/prims/whitebox.cpp

Print this page
rev 9003 : 8137167: JEP165: Compiler Control: Implementation task
Summary:
Reviewed-by:

*** 551,568 **** } jmethodID method_id, compilation_context_id; method_id = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(method_id)); if (compilation_context != NULL) { compilation_context_id = reflected_method_to_jmid(thread, env, compilation_context); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); methodHandle cch(THREAD, Method::checked_resolve_jmethod_id(compilation_context_id)); ! return CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, cch); } else { ! return CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, NULL); } WB_END WB_ENTRY(jint, WB_GetMethodCompilationLevel(JNIEnv* env, jobject o, jobject method, jboolean is_osr)) jmethodID jmid = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, CompLevel_none); --- 551,574 ---- } jmethodID method_id, compilation_context_id; method_id = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(method_id)); + + DirectiveSet* dirset; if (compilation_context != NULL) { compilation_context_id = reflected_method_to_jmid(thread, env, compilation_context); CHECK_JNI_EXCEPTION_(env, JNI_FALSE); methodHandle cch(THREAD, Method::checked_resolve_jmethod_id(compilation_context_id)); ! dirset = DirectivesStack::getMatchingDirective(cch, CompileBroker::compiler((int)compLevel)); } else { ! // Calling with NULL matches default directive ! dirset = DirectivesStack::getMatchingDirective(NULL, CompileBroker::compiler((int)compLevel)); } + bool result = CompileBroker::compiler(compLevel)->is_intrinsic_available(mh, dirset); + DirectivesStack::release(dirset); + return result; WB_END WB_ENTRY(jint, WB_GetMethodCompilationLevel(JNIEnv* env, jobject o, jobject method, jboolean is_osr)) jmethodID jmid = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, CompLevel_none);
*** 624,633 **** --- 630,669 ---- nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), "WhiteBox", THREAD); MutexLockerEx mu(Compile_lock); return (mh->queued_for_compilation() || nm != NULL); WB_END + WB_ENTRY(jint, WB_MatchesInline(JNIEnv* env, jobject o, jobject method, jstring pattern)) + jmethodID jmid = reflected_method_to_jmid(thread, env, method); + CHECK_JNI_EXCEPTION_(env, JNI_FALSE); + + methodHandle mh(THREAD, Method::checked_resolve_jmethod_id(jmid)); + + ResourceMark rm; + const char* error_msg = NULL; + char* method_str = java_lang_String::as_utf8_string(JNIHandles::resolve_non_null(pattern)); + InlineMatcher* m = InlineMatcher::parse_inline_pattern(method_str, error_msg); + + if (m == NULL) { + assert(error_msg != NULL, "Always have an error message"); + tty->print_cr("Got error: %s", error_msg); + return -1; // Pattern failed + } + + // Pattern works - now check if it matches + int result; + if (m->match(mh, InlineMatcher::force_inline)) { + result = 2; // Force inline match + } else if (m->match(mh, InlineMatcher::dont_inline)) { + result = 1; // Dont inline match + } else { + result = 0; // No match + } + delete m; + return result; + WB_END + WB_ENTRY(jint, WB_MatchesMethod(JNIEnv* env, jobject o, jobject method, jstring pattern)) jmethodID jmid = reflected_method_to_jmid(thread, env, method); CHECK_JNI_EXCEPTION_(env, JNI_FALSE);
*** 1458,1467 **** --- 1494,1506 ---- {CC"lockCompilation", CC"()V", (void*)&WB_LockCompilation}, {CC"unlockCompilation", CC"()V", (void*)&WB_UnlockCompilation}, {CC"matchesMethod", CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)I", (void*)&WB_MatchesMethod}, + {CC"matchesInline", + CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)I", + (void*)&WB_MatchesInline}, {CC"isConstantVMFlag", CC"(Ljava/lang/String;)Z", (void*)&WB_IsConstantVMFlag}, {CC"isLockedVMFlag", CC"(Ljava/lang/String;)Z", (void*)&WB_IsLockedVMFlag}, {CC"setBooleanVMFlag", CC"(Ljava/lang/String;Z)V",(void*)&WB_SetBooleanVMFlag}, {CC"setIntVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetIntVMFlag}, {CC"setUintVMFlag", CC"(Ljava/lang/String;J)V",(void*)&WB_SetUintVMFlag},
src/share/vm/prims/whitebox.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File