mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-19 18:44:38 +02:00
8136421: JEP 243: Java-Level JVM Compiler Interface
Reviewed-by: ihse, alanb, roland, coleenp, iveresov, kvn, kbarrett
This commit is contained in:
parent
f5b4bb46f5
commit
16526e000e
505 changed files with 50394 additions and 915 deletions
|
@ -1025,7 +1025,7 @@ WB_ENTRY(jobjectArray, WB_GetNMethod(JNIEnv* env, jobject o, jobject method, jbo
|
|||
ThreadToNativeFromVM ttn(thread);
|
||||
jclass clazz = env->FindClass(vmSymbols::java_lang_Object()->as_C_string());
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
result = env->NewObjectArray(4, clazz, NULL);
|
||||
result = env->NewObjectArray(5, clazz, NULL);
|
||||
if (result == NULL) {
|
||||
return result;
|
||||
}
|
||||
|
@ -1047,6 +1047,10 @@ WB_ENTRY(jobjectArray, WB_GetNMethod(JNIEnv* env, jobject o, jobject method, jbo
|
|||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
env->SetObjectArrayElement(result, 3, id);
|
||||
|
||||
jobject address = longBox(thread, env, (jlong) code);
|
||||
CHECK_JNI_EXCEPTION_(env, NULL);
|
||||
env->SetObjectArrayElement(result, 4, address);
|
||||
|
||||
return result;
|
||||
WB_END
|
||||
|
||||
|
@ -1133,6 +1137,13 @@ WB_ENTRY(jobjectArray, WB_GetCodeBlob(JNIEnv* env, jobject o, jlong addr))
|
|||
return codeBlob2objectArray(thread, env, &stub);
|
||||
WB_END
|
||||
|
||||
WB_ENTRY(jlong, WB_GetMethodData(JNIEnv* env, jobject wv, jobject method))
|
||||
jmethodID jmid = reflected_method_to_jmid(thread, env, method);
|
||||
CHECK_JNI_EXCEPTION_(env, 0);
|
||||
methodHandle mh(thread, Method::checked_resolve_jmethod_id(jmid));
|
||||
return (jlong) mh->method_data();
|
||||
WB_END
|
||||
|
||||
WB_ENTRY(jlong, WB_GetThreadStackSize(JNIEnv* env, jobject o))
|
||||
return (jlong) Thread::current()->stack_size();
|
||||
WB_END
|
||||
|
@ -1142,6 +1153,7 @@ WB_ENTRY(jlong, WB_GetThreadRemainingStackSize(JNIEnv* env, jobject o))
|
|||
return (jlong) t->stack_available(os::current_stack_pointer()) - (jlong) StackShadowPages * os::vm_page_size();
|
||||
WB_END
|
||||
|
||||
|
||||
int WhiteBox::array_bytes_to_length(size_t bytes) {
|
||||
return Array<u1>::bytes_to_length(bytes);
|
||||
}
|
||||
|
@ -1218,6 +1230,11 @@ WB_ENTRY(void, WB_ForceSafepoint(JNIEnv* env, jobject wb))
|
|||
VMThread::execute(&force_safepoint_op);
|
||||
WB_END
|
||||
|
||||
WB_ENTRY(long, WB_GetConstantPool(JNIEnv* env, jobject wb, jclass klass))
|
||||
instanceKlassHandle ikh(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
|
||||
return (long) ikh->constants();
|
||||
WB_END
|
||||
|
||||
template <typename T>
|
||||
static bool GetMethodOption(JavaThread* thread, JNIEnv* env, jobject method, jstring name, T* value) {
|
||||
assert(value != NULL, "sanity");
|
||||
|
@ -1509,12 +1526,15 @@ static JNINativeMethod methods[] = {
|
|||
{CC"getCodeHeapEntries", CC"(I)[Ljava/lang/Object;",(void*)&WB_GetCodeHeapEntries },
|
||||
{CC"getCompilationActivityMode",
|
||||
CC"()I", (void*)&WB_GetCompilationActivityMode},
|
||||
{CC"getMethodData0", CC"(Ljava/lang/reflect/Executable;)J",
|
||||
(void*)&WB_GetMethodData },
|
||||
{CC"getCodeBlob", CC"(J)[Ljava/lang/Object;",(void*)&WB_GetCodeBlob },
|
||||
{CC"getThreadStackSize", CC"()J", (void*)&WB_GetThreadStackSize },
|
||||
{CC"getThreadRemainingStackSize", CC"()J", (void*)&WB_GetThreadRemainingStackSize },
|
||||
{CC"assertMatchingSafepointCalls", CC"(ZZ)V", (void*)&WB_AssertMatchingSafepointCalls },
|
||||
{CC"isMonitorInflated0", CC"(Ljava/lang/Object;)Z", (void*)&WB_IsMonitorInflated },
|
||||
{CC"forceSafepoint", CC"()V", (void*)&WB_ForceSafepoint },
|
||||
{CC"getConstantPool0", CC"(Ljava/lang/Class;)J", (void*)&WB_GetConstantPool },
|
||||
{CC"getMethodBooleanOption",
|
||||
CC"(Ljava/lang/reflect/Executable;Ljava/lang/String;)Ljava/lang/Boolean;",
|
||||
(void*)&WB_GetMethodBooleaneOption},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue