comparison src/share/vm/graal/graalVMEntries.cpp @ 3020:9fed07e4a375

Changed from method/reflect object back to methodOop, because using method/reflection can create deadlock with the user application (test with -Xcomp). Disabled method caching by default and created a flag -G:StoreResultGraph (otherwise eclipse will fail because of being out of memory).
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Sat, 18 Jun 2011 21:23:40 +0200
parents 681a227c332b
children fecdb0a65fb2
comparison
equal deleted inserted replaced
3019:77bb196828cb 3020:9fed07e4a375
37 } 37 }
38 38
39 methodOop getMethodFromHotSpotMethod(oop hotspot_method) { 39 methodOop getMethodFromHotSpotMethod(oop hotspot_method) {
40 oop reflected = HotSpotMethodResolved::javaMirror(hotspot_method); 40 oop reflected = HotSpotMethodResolved::javaMirror(hotspot_method);
41 assert(reflected != NULL, "NULL not expected"); 41 assert(reflected != NULL, "NULL not expected");
42 42 return (methodOop)reflected;
43
44 // (tw) Cannot use reflection code, because then the compiler can dead lock with the user application (test using -Xcomp).
45 /*
43 // method is a handle to a java.lang.reflect.Method object 46 // method is a handle to a java.lang.reflect.Method object
44 oop mirror = NULL; 47 oop mirror = NULL;
45 int slot = 0; 48 int slot = 0;
46 49
47 if (reflected->klass() == SystemDictionary::reflect_Constructor_klass()) { 50 if (reflected->klass() == SystemDictionary::reflect_Constructor_klass()) {
56 59
57 // Make sure class is initialized before handing id's out to methods 60 // Make sure class is initialized before handing id's out to methods
58 // assert(instanceKlass::cast(k)->is_initialized(), "only initialized classes expected"); 61 // assert(instanceKlass::cast(k)->is_initialized(), "only initialized classes expected");
59 methodOop m = instanceKlass::cast(k)->method_with_idnum(slot); 62 methodOop m = instanceKlass::cast(k)->method_with_idnum(slot);
60 assert(m != NULL, "deleted method?"); 63 assert(m != NULL, "deleted method?");
61 return m; 64 return m;*/
62 } 65 }
63 66
64 oop getReflectedMethod(methodOop method, TRAPS) { 67 oop getReflectedMethod(methodOop method, TRAPS) {
65 assert(method != NULL, "NULL not expected"); 68 assert(method != NULL, "NULL not expected");
66 69
366 369
367 // public RiMethod RiConstantPool_lookupMethod(long vmId, int cpi, byte byteCode); 370 // public RiMethod RiConstantPool_lookupMethod(long vmId, int cpi, byte byteCode);
368 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) { 371 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) {
369 TRACE_graal_3("VMEntries::RiConstantPool_lookupMethod"); 372 TRACE_graal_3("VMEntries::RiConstantPool_lookupMethod");
370 VM_ENTRY_MARK; 373 VM_ENTRY_MARK;
371
372 index = GraalCompiler::to_cp_index_u2(index); 374 index = GraalCompiler::to_cp_index_u2(index);
373 constantPoolHandle cp = VmIds::get<constantPoolOop>(vmId); 375 constantPoolHandle cp = VmIds::get<constantPoolOop>(vmId);
374 376
375 Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF); 377 Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF);
376 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); 378 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder());