comparison src/share/vm/graal/graalCompilerToVM.cpp @ 8611:6c4db417385a

added API to reset the profiling information for a method added some test cases that check the recorded profiling information
author Christian Haeubl <haeubl@ssw.jku.at>
date Wed, 27 Mar 2013 17:25:59 +0100
parents 2ffd472c5d25
children cd9e8dd9f488
comparison
equal deleted inserted replaced
8610:5407d1dd6450 8611:6c4db417385a
1005 Handle result = java_lang_String::create_from_unicode(name, length, CHECK_NULL); 1005 Handle result = java_lang_String::create_from_unicode(name, length, CHECK_NULL);
1006 return JNIHandles::make_local(result()); 1006 return JNIHandles::make_local(result());
1007 1007
1008 C2V_END 1008 C2V_END
1009 1009
1010
1011 C2V_VMENTRY(void, reprofile, (JNIEnv *env, jobject, jlong metaspace_method))
1012 Method* method = asMethod(metaspace_method);
1013 method->reset_counters();
1014
1015 nmethod* code = method->code();
1016 if (code != NULL) {
1017 code->make_not_entrant();
1018 }
1019
1020 MethodData* method_data = method->method_data();
1021 if (method_data == NULL) {
1022 ClassLoaderData* loader_data = method->method_holder()->class_loader_data();
1023 method_data = MethodData::allocate(loader_data, method, CHECK);
1024 method->set_method_data(method_data);
1025 } else {
1026 method_data->initialize();
1027 }
1028 C2V_END
1029
1030
1031
1010 #define CC (char*) /*cast a literal from (const char*)*/ 1032 #define CC (char*) /*cast a literal from (const char*)*/
1011 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) 1033 #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f))
1012 1034
1013 #define RESOLVED_TYPE "Lcom/oracle/graal/api/meta/ResolvedJavaType;" 1035 #define RESOLVED_TYPE "Lcom/oracle/graal/api/meta/ResolvedJavaType;"
1014 #define TYPE "Lcom/oracle/graal/api/meta/JavaType;" 1036 #define TYPE "Lcom/oracle/graal/api/meta/JavaType;"
1078 {CC"executeCompiledMethodVarargs", CC"("METASPACE_METHOD NMETHOD "["OBJECT")"OBJECT, FN_PTR(executeCompiledMethodVarargs)}, 1100 {CC"executeCompiledMethodVarargs", CC"("METASPACE_METHOD NMETHOD "["OBJECT")"OBJECT, FN_PTR(executeCompiledMethodVarargs)},
1079 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)}, 1101 {CC"getDeoptedLeafGraphIds", CC"()[J", FN_PTR(getDeoptedLeafGraphIds)},
1080 {CC"getLineNumberTable", CC"("HS_RESOLVED_METHOD")[J", FN_PTR(getLineNumberTable)}, 1102 {CC"getLineNumberTable", CC"("HS_RESOLVED_METHOD")[J", FN_PTR(getLineNumberTable)},
1081 {CC"getLocalVariableTable", CC"("HS_RESOLVED_METHOD")["LOCAL, FN_PTR(getLocalVariableTable)}, 1103 {CC"getLocalVariableTable", CC"("HS_RESOLVED_METHOD")["LOCAL, FN_PTR(getLocalVariableTable)},
1082 {CC"getFileName", CC"("HS_RESOLVED_JAVA_TYPE")"STRING, FN_PTR(getFileName)}, 1104 {CC"getFileName", CC"("HS_RESOLVED_JAVA_TYPE")"STRING, FN_PTR(getFileName)},
1105 {CC"reprofile", CC"("METASPACE_METHOD")V", FN_PTR(reprofile)},
1083 }; 1106 };
1084 1107
1085 int CompilerToVM_methods_count() { 1108 int CompilerToVM_methods_count() {
1086 return sizeof(CompilerToVM_methods) / sizeof(JNINativeMethod); 1109 return sizeof(CompilerToVM_methods) / sizeof(JNINativeMethod);
1087 } 1110 }