diff src/share/vm/graal/graalVMEntries.cpp @ 3619:5e9645341ec3

support for new RiRuntime features: add code without making it the default for the method, executing Java tasks on the compile thread, communicate nmethod reference to Java code as HotSpotCompiledMethod
author Lukas Stadler <lukas.stadler@jku.at>
date Wed, 09 Nov 2011 11:27:38 +0100
parents 1692a2f9bfc5
children 75e92277ad05
line wrap: on
line diff
--- a/src/share/vm/graal/graalVMEntries.cpp	Tue Oct 25 14:44:32 2011 +0200
+++ b/src/share/vm/graal/graalVMEntries.cpp	Wed Nov 09 11:27:38 2011 +0100
@@ -24,6 +24,7 @@
 #include "precompiled.hpp"
 #include "c1/c1_Runtime1.hpp"
 #include "ci/ciMethodData.hpp"
+#include "compiler/compileBroker.hpp"
 #include "graal/graalVMEntries.hpp"
 #include "graal/graalCompiler.hpp"
 #include "graal/graalJavaAccess.hpp"
@@ -986,18 +987,20 @@
   return config;
 }
 
-// public void installMethod(HotSpotTargetMethod targetMethod);
-JNIEXPORT void JNICALL Java_com_oracle_graal_hotspot_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod) {
+// public long installMethod(HotSpotTargetMethod targetMethod, boolean installCode);
+JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod, jboolean install_code) {
   VM_ENTRY_MARK;
+  nmethod* nm = NULL;
   if (CURRENT_ENV == NULL) {
     Arena arena;
     ciEnv env(&arena);
     ResourceMark rm;
-    CodeInstaller installer(JNIHandles::resolve(targetMethod));
+    CodeInstaller installer(JNIHandles::resolve(targetMethod), nm, install_code);
   } else {
     ResourceMark rm;
-    CodeInstaller installer(JNIHandles::resolve(targetMethod));
+    CodeInstaller installer(JNIHandles::resolve(targetMethod), nm, install_code);
   }
+  return (jlong) nm;
 }
 
 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name);
@@ -1027,6 +1030,11 @@
   }
 }
 
+// public void notifyJavaQueue();
+JNIEXPORT void JNICALL Java_com_oracle_graal_hotspot_VMEntries_notifyJavaQueue(JNIEnv *jniEnv, jobject) {
+  CompileBroker::notify_java_queue();
+}
+
 
 
 
@@ -1088,9 +1096,10 @@
   {CC"getMaxCallTargetOffset",            CC"("CI_RUNTIME_CALL")J",                   FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_getMaxCallTargetOffset)},
   {CC"getType",                           CC"("CLASS")"TYPE,                          FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_getType)},
   {CC"getConfiguration",                  CC"()"CONFIG,                               FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_getConfiguration)},
-  {CC"installMethod",                     CC"("TARGET_METHOD")V",                     FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_installMethod)},
+  {CC"installMethod",                     CC"("TARGET_METHOD"Z)J",                    FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_installMethod)},
   {CC"installStub",                       CC"("TARGET_METHOD")"PROXY,                 FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_installStub)},
-  {CC"recordBailout",                     CC"("STRING")V",                            FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_recordBailout)}
+  {CC"recordBailout",                     CC"("STRING")V",                            FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_recordBailout)},
+  {CC"notifyJavaQueue",                   CC"()V",                                    FN_PTR(Java_com_oracle_graal_hotspot_VMEntries_notifyJavaQueue)}
 };
 
 int VMEntries_methods_count() {