Mercurial > hg > graal-compiler
diff src/share/vm/graal/graalCompilerToVM.cpp @ 11852:d7964e96b0b0
move benchmark counters into separate class and make them correct for multithreaded applications
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Mon, 30 Sep 2013 18:32:26 +0200 |
parents | 7cca436d600b |
children | 359f7e70ae7f |
line wrap: on
line diff
--- a/src/share/vm/graal/graalCompilerToVM.cpp Mon Sep 30 14:02:07 2013 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Mon Sep 30 18:32:26 2013 +0200 @@ -875,6 +875,9 @@ set_int("arrayClassElementOffset", in_bytes(ObjArrayKlass::element_klass_offset())); + set_int("graalCountersThreadOffset", in_bytes(JavaThread::graal_counters_offset())); + set_int("graalCountersSize", (jint) GRAAL_COUNTERS_SIZE); + #undef set_boolean #undef set_int #undef set_long @@ -1145,6 +1148,12 @@ return klass; C2V_END +C2V_VMENTRY(jlongArray, collectCounters, (JNIEnv *env, jobject)) + typeArrayOop arrayOop = oopFactory::new_longArray(GRAAL_COUNTERS_SIZE, CHECK_NULL); + JavaThread::collect_counters(arrayOop); + return (jlongArray) JNIHandles::make_local(arrayOop); +C2V_END + #define CC (char*) /*cast a literal from (const char*)*/ #define FN_PTR(f) CAST_FROM_FN_PTR(void*, &(c2v_ ## f)) @@ -1224,6 +1233,7 @@ {CC"invalidateInstalledCode", CC"("HS_INSTALLED_CODE")V", FN_PTR(invalidateInstalledCode)}, {CC"readUnsafeUncompressedPointer", CC"("OBJECT"J)"OBJECT, FN_PTR(readUnsafeUncompressedPointer)}, {CC"readUnsafeKlassPointer", CC"("OBJECT")J", FN_PTR(readUnsafeKlassPointer)}, + {CC"collectCounters", CC"()[J", FN_PTR(collectCounters)}, }; int CompilerToVM_methods_count() {