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 10344 : 8150646: Add support for blocking compiles through whitebox API

*** 28,37 **** --- 28,38 ---- #include "classfile/classLoaderData.hpp" #include "classfile/stringTable.hpp" #include "code/codeCache.hpp" #include "compiler/methodMatcher.hpp" + #include "compiler/directivesParser.hpp" #include "jvmtifiles/jvmtiEnv.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceShared.hpp" #include "memory/universe.hpp" #include "oops/constantPool.hpp"
*** 1500,1509 **** --- 1501,1526 ---- } } } } + WB_ENTRY(jint, WB_AddCompilerDirective(JNIEnv* env, jobject o, jstring compDirect)) + char* tmpstr = NULL; + { + // can't be in VM when we call JNI + ThreadToNativeFromVM ttnfv(thread); + const char* dirstr = env->GetStringUTFChars(compDirect, NULL); + tmpstr = strdup(dirstr); + env->ReleaseStringUTFChars(compDirect, dirstr); + } + return (jint) DirectivesParser::parse_string(tmpstr, tty);; + WB_END + + WB_ENTRY(void, WB_RemoveCompilerDirective(JNIEnv* env, jobject o, jint count)) + DirectivesStack::pop(count); + WB_END + #define CC (char*) static JNINativeMethod methods[] = { {CC"getObjectAddress0", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectAddress }, {CC"getObjectSize0", CC"(Ljava/lang/Object;)J", (void*)&WB_GetObjectSize },
*** 1675,1684 **** --- 1692,1704 ---- CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/String;", (void*)&WB_GetMethodStringOption}, {CC"isShared", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsShared }, {CC"areSharedStringsIgnored", CC"()Z", (void*)&WB_AreSharedStringsIgnored }, {CC"clearInlineCaches", CC"()V", (void*)&WB_ClearInlineCaches }, + {CC"addCompilerDirective", CC"(Ljava/lang/String;)I", + (void*)&WB_AddCompilerDirective }, + {CC"removeCompilerDirective", CC"(I)V", (void*)&WB_RemoveCompilerDirective }, }; #undef CC JVM_ENTRY(void, JVM_RegisterWhiteBoxMethods(JNIEnv* env, jclass wbclass))
src/share/vm/prims/whitebox.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File