Mercurial > hg > truffle
comparison src/share/vm/graal/graalVMEntries.cpp @ 3667:e755289380e3
Removed a safepoint possibility in the code installer when creating CiVirtualObject objects.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 18 Nov 2011 13:07:25 +0100 |
parents | 8c46cdb684d4 |
children | 53636e2c9d03 |
comparison
equal
deleted
inserted
replaced
3664:6e1abd79e7c8 | 3667:e755289380e3 |
---|---|
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 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); | |
928 nmethod* nm = NULL; | 929 nmethod* nm = NULL; |
929 ciEnv* current_env = JavaThread::current()->env(); | 930 ciEnv* current_env = JavaThread::current()->env(); |
930 JavaThread::current()->set_env(NULL); | 931 JavaThread::current()->set_env(NULL); |
931 Arena arena; | 932 Arena arena; |
932 ciEnv env(&arena); | 933 ciEnv env(&arena); |
933 ResourceMark rm; | 934 ResourceMark rm; |
934 CodeInstaller installer(JNIHandles::resolve(targetMethod), nm, install_code != 0); | 935 CodeInstaller installer(targetMethodHandle, nm, install_code != 0); |
935 JavaThread::current()->set_env(current_env); | 936 JavaThread::current()->set_env(current_env); |
936 return (jlong) nm; | 937 return (jlong) nm; |
937 } | 938 } |
938 | 939 |
939 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name); | 940 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name); |
940 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { | 941 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { |
941 VM_ENTRY_MARK; | 942 VM_ENTRY_MARK; |
943 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); | |
942 jlong id; | 944 jlong id; |
943 ciEnv* current_env = JavaThread::current()->env(); | 945 ciEnv* current_env = JavaThread::current()->env(); |
944 JavaThread::current()->set_env(NULL); | 946 JavaThread::current()->set_env(NULL); |
945 Arena arena; | 947 Arena arena; |
946 ciEnv env(&arena); | 948 ciEnv env(&arena); |
947 ResourceMark rm; | 949 ResourceMark rm; |
948 CodeInstaller installer(JNIHandles::resolve(targetMethod), id); | 950 CodeInstaller installer(targetMethodHandle, id); |
949 JavaThread::current()->set_env(current_env); | 951 JavaThread::current()->set_env(current_env); |
950 return id; | 952 return id; |
951 } | 953 } |
952 | 954 |
953 // public void recordBailout(String reason); | 955 // public void recordBailout(String reason); |