Mercurial > hg > truffle
comparison src/share/vm/graal/graalVMEntries.cpp @ 3670:f198b24093f3
put back in thread transitions.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 18 Nov 2011 16:23:26 +0100 |
parents | 53636e2c9d03 |
children | d3d3dd0a3421 7958ebb561b0 |
comparison
equal
deleted
inserted
replaced
3669:53636e2c9d03 | 3670:f198b24093f3 |
---|---|
465 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jobject type, jint index, jbyte byteCode) { | 465 JNIEXPORT jobject JNICALL Java_com_oracle_graal_hotspot_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jobject type, jint index, jbyte byteCode) { |
466 TRACE_graal_3("VMEntries::RiConstantPool_lookupMethod"); | 466 TRACE_graal_3("VMEntries::RiConstantPool_lookupMethod"); |
467 VM_ENTRY_MARK; | 467 VM_ENTRY_MARK; |
468 index = GraalCompiler::to_cp_index_u2(index); | 468 index = GraalCompiler::to_cp_index_u2(index); |
469 constantPoolHandle cp = instanceKlass::cast(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type)))->constants(); | 469 constantPoolHandle cp = instanceKlass::cast(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(type)))->constants(); |
470 instanceKlassHandle pool_holder(cp->pool_holder()); | |
470 | 471 |
471 Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF); | 472 Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF); |
472 methodHandle method = GraalEnv::get_method_by_index(cp, index, bc, cp->pool_holder()); | 473 methodHandle method = GraalEnv::get_method_by_index(cp, index, bc, pool_holder); |
473 if (!method.is_null()) { | 474 if (!method.is_null()) { |
474 Handle ret = GraalCompiler::createHotSpotMethodResolved(method, CHECK_NULL); | 475 Handle ret = GraalCompiler::createHotSpotMethodResolved(method, CHECK_NULL); |
475 return JNIHandles::make_local(THREAD, ret()); | 476 return JNIHandles::make_local(THREAD, ret()); |
476 } else { | 477 } else { |
477 // Get the method's name and signature. | 478 // Get the method's name and signature. |
924 | 925 |
925 // public long installMethod(HotSpotTargetMethod targetMethod, boolean installCode); | 926 // 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) { | 927 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installMethod(JNIEnv *jniEnv, jobject, jobject targetMethod, jboolean install_code) { |
927 VM_ENTRY_MARK; | 928 VM_ENTRY_MARK; |
928 ResourceMark rm; | 929 ResourceMark rm; |
930 HandleMark hm; | |
929 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); | 931 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); |
930 nmethod* nm = NULL; | 932 nmethod* nm = NULL; |
931 Arena arena; | 933 Arena arena; |
932 ciEnv env(&arena); | 934 ciEnv env(&arena); |
933 CodeInstaller installer(targetMethodHandle, nm, install_code != 0); | 935 CodeInstaller installer(targetMethodHandle, nm, install_code != 0); |
936 | 938 |
937 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name); | 939 // public HotSpotProxy installStub(HotSpotTargetMethod targetMethod, String name); |
938 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { | 940 JNIEXPORT jlong JNICALL Java_com_oracle_graal_hotspot_VMEntries_installStub(JNIEnv *jniEnv, jobject, jobject targetMethod) { |
939 VM_ENTRY_MARK; | 941 VM_ENTRY_MARK; |
940 ResourceMark rm; | 942 ResourceMark rm; |
943 HandleMark hm; | |
941 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); | 944 Handle targetMethodHandle = JNIHandles::resolve(targetMethod); |
942 jlong id; | 945 jlong id; |
943 Arena arena; | 946 Arena arena; |
944 ciEnv env(&arena); | 947 ciEnv env(&arena); |
945 CodeInstaller installer(targetMethodHandle, id); | 948 CodeInstaller installer(targetMethodHandle, id); |