Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalVMEntries.cpp @ 3669:53636e2c9d03
No longer use shared ciFactory. Remove make_global usage in code installer.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 18 Nov 2011 14:14:37 +0100 |
parents | e755289380e3 |
children | f198b24093f3 |
comparison
equal
deleted
inserted
replaced
3668:46f211fe010c | 3669:53636e2c9d03 |
---|---|
923 } | 923 } |
924 | 924 |
925 // public long installMethod(HotSpotTargetMethod targetMethod, boolean installCode); | 925 // public long installMethod(HotSpotTargetMethod targetMethod, boolean installCode); |
926 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod, jboolean install_code) { | 926 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod, jboolean install_code) { |
927 VM_ENTRY_MARK; | 927 VM_ENTRY_MARK; |
928 ResourceMark rm; | |
928 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); | 929 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); |
929 nmethod* nm = NULL; | 930 nmethod* nm = NULL; |
930 ciEnv* current_env = JavaThread::current()->env(); | |
931 JavaThread::current()->set_env(NULL); | |
932 Arena arena; | 931 Arena arena; |
933 ciEnv env(&arena); | 932 ciEnv env(&arena); |
934 ResourceMark rm; | |
935 CodeInstaller installer(targetMethodHandle, nm, install_code != 0); | 933 CodeInstaller installer(targetMethodHandle, nm, install_code != 0); |
936 JavaThread::current()->set_env(current_env); | |
937 return (jlong) nm; | 934 return (jlong) nm; |
938 } | 935 } |
939 | 936 |
940 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name); | 937 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name); |
941 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { | 938 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { |
942 VM_ENTRY_MARK; | 939 VM_ENTRY_MARK; |
940 ResourceMark rm; | |
943 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); | 941 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); |
944 jlong id; | 942 jlong id; |
945 ciEnv* current_env = JavaThread::current()->env(); | |
946 JavaThread::current()->set_env(NULL); | |
947 Arena arena; | 943 Arena arena; |
948 ciEnv env(&arena); | 944 ciEnv env(&arena); |
949 ResourceMark rm; | |
950 CodeInstaller installer(targetMethodHandle, id); | 945 CodeInstaller installer(targetMethodHandle, id); |
951 JavaThread::current()->set_env(current_env); | |
952 return id; | 946 return id; |
953 } | 947 } |
954 | 948 |
955 // public void recordBailout(String reason); | 949 // public void recordBailout(String reason); |
956 JNIEXPORT void JNICALL Java_com_oracle_graal_hotspot_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) { | 950 JNIEXPORT void JNICALL Java_com_oracle_graal_hotspot_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) { |