* src/vmcore/statistics.c (count_calls_java_to_native): Added.
authortwisti <none@none>
Tue, 5 Jun 2007 07:40:49 +0000 (07:40 +0000)
committertwisti <none@none>
Tue, 5 Jun 2007 07:40:49 +0000 (07:40 +0000)
(count_calls_native_to_java): Likewise.
(count_native_function_calls): Removed.
(nativeinvokation): Likewise.
(print_stats): Print new variables.

* src/vmcore/statistics.h (count_calls_java_to_native): Added.
(count_calls_native_to_java): Likewise.
(nativeinvokation): Removed.

* src/vm/jit/codegen-common.c (codegen_start_native_call)
[ENABLE_STATISTICS]: Increase count_calls_java_to_native.

* src/vm/vm.c (vm_call_method_vmarg) [ENABLE_STATISTICS]: Increase
count_calls_native_to_java.
(vm_call_method_int_vmarg): Likewise.
(vm_call_method_long_vmarg): Likewise.
(vm_call_method_float_vmarg): Likewise.
(vm_call_method_double_vmarg): Likewise.

src/vm/jit/codegen-common.c
src/vm/vm.c
src/vmcore/statistics.c
src/vmcore/statistics.h

index 0f5c62253839fe13b3c21a30d622ceb498d6a6b4..508b7265f2cd91930090b458993fdacac51abffb 100644 (file)
@@ -39,7 +39,7 @@
    memory. All functions writing values into the data area return the offset
    relative the begin of the code area (start of procedure).   
 
-   $Id: codegen-common.c 7966 2007-05-25 12:41:03Z pm $
+   $Id: codegen-common.c 8006 2007-06-05 07:40:49Z twisti $
 
 */
 
@@ -1376,6 +1376,8 @@ void codegen_start_native_call(u1 *datasp, u1 *pv, u1 *sp, u1 *ra)
        stackframeinfo *sfi;
        localref_table *lrt;
 
+       STATISTICS(count_calls_java_to_native++);
+
        /* get data structures from stack */
 
        sfi = (stackframeinfo *) (datasp - sizeof(stackframeinfo));
index 36bcd39de4b5a5997ca04a51b4b76d9f6da9a660..a69959995e1ef167bfacba7e69766ae17242d623 100644 (file)
@@ -2534,6 +2534,8 @@ java_objectheader *vm_call_method_vmarg(methodinfo *m, s4 vmargscount,
 {
        java_objectheader *o;
 
+       STATISTICS(count_calls_native_to_java++);
+
 #if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
        if (opt_intrp)
@@ -2664,6 +2666,8 @@ s4 vm_call_method_int_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
 {
        s4 i;
 
+       STATISTICS(count_calls_native_to_java++);
+
 #if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
        if (opt_intrp)
@@ -2794,6 +2798,8 @@ s8 vm_call_method_long_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
 {
        s8 l;
 
+       STATISTICS(count_calls_native_to_java++);
+
 #if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
        if (opt_intrp)
@@ -2926,6 +2932,8 @@ float vm_call_method_float_vmarg(methodinfo *m, s4 vmargscount, vm_arg *vmargs)
 {
        float f;
 
+       STATISTICS(count_calls_native_to_java++);
+
 #if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
        if (opt_intrp)
@@ -3059,6 +3067,8 @@ double vm_call_method_double_vmarg(methodinfo *m, s4 vmargscount,
 {
        double d;
 
+       STATISTICS(count_calls_native_to_java++);
+
 #if defined(ENABLE_JIT)
 # if defined(ENABLE_INTRP)
        if (opt_intrp)
index 3903a82cefaea2ccd96629accfd249153dad085c..b97064ace03684a0dae64727f6d550b9d3d09348 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: statistics.c 7956 2007-05-23 18:08:42Z twisti $
+   $Id: statistics.c 8006 2007-06-05 07:40:49Z twisti $
 
 */
 
@@ -103,6 +103,9 @@ s4 size_lock_record      = 0;
 s4 size_lock_hashtable   = 0;
 s4 size_lock_waiter      = 0;
 
+u8 count_calls_java_to_native = 0;
+u8 count_calls_native_to_java = 0;
+
 int count_const_pool_len = 0;
 int count_classref_len = 0;
 int count_parsed_desc_len = 0;
@@ -177,7 +180,6 @@ int count_upper_bound_new_stack = 0;
 s4 count_branches_resolved   = 0;
 s4 count_branches_unresolved = 0;
 
-u8 count_native_function_calls=0;
 u8 count_jni_callXmethod_calls=0;
 u8 count_jni_calls=0;
 
@@ -229,19 +231,6 @@ s4 count_schedule_max_leaders = 0;
 s4 count_schedule_critical_path = 0;
 
 
-/* nativeinvokation ***********************************************************
-
-   increments the native invokation count by one
-       
-*******************************************************************************/
-
-void nativeinvokation(void)
-{
-       /* XXX do locking here */
-       count_native_function_calls++;
-}
-
-
 /* jnicallXmethodinvokation ***************************************************
 
    increments the jni CallXMethod invokation count by one
@@ -590,13 +579,14 @@ void print_stats(void)
        /* call statistics ********************************************************/
 
        dolog("Function call statistics:");
-       dolog("Number of native function invokations:           %ld",
-                 count_native_function_calls);
        dolog("Number of jni->CallXMethod function invokations: %ld",
                  count_jni_callXmethod_calls);
        dolog("Overall number of jni invokations:               %ld",
                  count_jni_calls);
 
+       log_println("java-to-native calls:   %10ld", count_calls_java_to_native);
+       log_println("native-to-java calls:   %10ld", count_calls_native_to_java);
+
 
        /* now print other statistics ********************************************/
 
index e9ad8d4df98ffaf6fdf75fdce5899227033aded8..0393ba0f6f0b0d6d2d85453989c81fe102d6386f 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: statistics.h 7916 2007-05-18 14:24:21Z twisti $
+   $Id: statistics.h 8006 2007-06-05 07:40:49Z twisti $
 
 */
 
@@ -106,6 +106,9 @@ extern s4 size_lock_record;
 extern s4 size_lock_hashtable;
 extern s4 size_lock_waiter;
 
+extern u8 count_calls_java_to_native;
+extern u8 count_calls_native_to_java;
+
 extern int count_const_pool_len;
 extern int count_classref_len;
 extern int count_parsed_desc_len;
@@ -226,7 +229,6 @@ void statistics_print_gc_memory_usage(void);
 
 void mem_usagelog(bool givewarnings);
 
-void nativeinvokation(void);
 void compiledinvokation(void);
 void jnicallXmethodnvokation(void);
 void jniinvokation(void);