src/share/vm/prims/whitebox.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/prims/whitebox.cpp	Tue Mar  1 14:59:45 2016
--- new/src/share/vm/prims/whitebox.cpp	Tue Mar  1 14:59:45 2016

*** 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(jboolean, 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 (jboolean) DirectivesParser::parse_string(tmpstr, tty);; + WB_END + + WB_ENTRY(void, WB_RemoveCompilerDirective(JNIEnv* env, jobject o)) + DirectivesStack::pop(); + 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;)Z", + (void*)&WB_AddCompilerDirective }, + {CC"removeCompilerDirective", CC"()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