* src/vmcore/rt-timing.c: Added rt-timing for heap allocation time.
authormichi <none@none>
Sat, 3 Mar 2007 00:20:18 +0000 (00:20 +0000)
committermichi <none@none>
Sat, 3 Mar 2007 00:20:18 +0000 (00:20 +0000)
* src/vmcore/rt-timing.h: See above.

* src/mm/boehm.c (heap_allocate): Heap allocation time is measured.

* src/mm/cacao-gc/heap.c (heap_allocate): Heap allocation time is measured.

--HG--
branch : exact-gc

src/mm/boehm.c
src/mm/cacao-gc/heap.c
src/vm/jit/s390/emit.c
src/vmcore/rt-timing.c
src/vmcore/rt-timing.h

index 81c028ccee63e69002df91493c4816ebbce3681b..7e8edbaf094bece6a63affa3117f14f2832d79ad 100644 (file)
@@ -22,7 +22,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   $Id: boehm.c 7355 2007-02-14 10:57:32Z twisti $
+   $Id: boehm.c 7443 2007-03-03 00:20:18Z michi $
 
 */
 
@@ -52,6 +52,7 @@
 
 #include "vmcore/loader.h"
 #include "vmcore/options.h"
+#include "vmcore/rt-timing.h"
 
 
 /* global variables ***********************************************************/
@@ -135,6 +136,11 @@ void *heap_alloc_uncollectable(u4 bytelength)
 void *heap_allocate(u4 bytelength, u4 references, methodinfo *finalizer)
 {
        void *p;
+#if defined(ENABLE_RT_TIMING)
+       struct timespec time_start, time_end;
+#endif
+
+       RT_TIMING_GET_TIME(time_start);
 
        /* We can't use a bool here for references, as it's passed as a
           bitmask in builtin_new.  Thus we check for != 0. */
@@ -154,6 +160,9 @@ void *heap_allocate(u4 bytelength, u4 references, methodinfo *finalizer)
 
        MSET(p, 0, u1, bytelength);
 
+       RT_TIMING_GET_TIME(time_end);
+       RT_TIMING_TIME_DIFF(time_start, time_end, RT_TIMING_GC_ALLOC);
+
        return p;
 }
 
index 64fea491ae1b53bcea7cecd7ca9494d6fd74aaab..9424bc62e657c63d290ccb99919e4c9d4ff1d83a 100644 (file)
@@ -42,6 +42,7 @@
 #include "src/native/include/java_lang_String.h" /* TODO: fix me! */
 #include "toolbox/logging.h"
 #include "vm/global.h"
+#include "vmcore/rt-timing.h"
 
 
 /* Global Variables ***********************************************************/
@@ -206,6 +207,11 @@ static java_objectheader *heap_alloc_intern(u4 bytelength, regioninfo_t *region)
 void *heap_allocate(u4 bytelength, u4 references, methodinfo *finalizer)
 {
        java_objectheader *p;
+#if defined(ENABLE_RT_TIMING)
+       struct timespec time_start, time_end;
+#endif
+
+       RT_TIMING_GET_TIME(time_start);
 
        p = heap_alloc_intern(bytelength, heap_region_main);
 
@@ -232,6 +238,9 @@ void *heap_allocate(u4 bytelength, u4 references, methodinfo *finalizer)
                final_register(p, finalizer);
        }
 
+       RT_TIMING_GET_TIME(time_end);
+       RT_TIMING_TIME_DIFF(time_start, time_end, RT_TIMING_GC_ALLOC);
+
        return p;
 }
 
index 4e91c158311821a23b297719670defda2a0b1b27..a93fab1d3b4f4b87aa5bdd00c8adbd7e65a32b60 100644 (file)
@@ -26,7 +26,7 @@
 
    Authors: Christian Thalinger
 
-   $Id: emit.c 7355 2007-02-14 10:57:32Z twisti $
+   $Id: emit.c 7300 2007-02-07 22:06:53Z pm $
 
 */
 
index bb2b554678ed28eb92fe1783533da2c5d09b0f18..f8e32889f6966d22ec6a634246d7440f3a850b28 100644 (file)
@@ -110,6 +110,7 @@ static struct rt_timing_stat rt_timing_stat_defs[] = {
        { RT_TIMING_NEW_ARRAY       ,-1                       , "builtin_newarray time" },
     { -1                        ,-1                       , "" },
 
+       { RT_TIMING_GC_ALLOC        ,-1                       , "heap allocation time" },
 #if defined(ENABLE_GC_CACAO)
        { RT_TIMING_GC_SUSPEND      ,RT_TIMING_GC_TOTAL       , "gc: suspending threads" },
        { RT_TIMING_GC_ROOTSET1     ,RT_TIMING_GC_TOTAL       , "gc: rootset finding" },
index e69b0dec5620056aeb0c7695c857c980f4454587..88955dcddb7559f127d9ad3857f486bac6b64b31 100644 (file)
 #define RT_TIMING_NEW_OBJECT       46
 #define RT_TIMING_NEW_ARRAY        47
 
-#define RT_TIMING_GC_SUSPEND       48
-#define RT_TIMING_GC_ROOTSET1      49
-#define RT_TIMING_GC_MARK          50
-#define RT_TIMING_GC_COMPACT       51
-#define RT_TIMING_GC_ROOTSET2      52
-#define RT_TIMING_GC_TOTAL         53
-
-#define RT_TIMING_N                54
+#define RT_TIMING_GC_ALLOC         48
+#define RT_TIMING_GC_SUSPEND       49
+#define RT_TIMING_GC_ROOTSET1      50
+#define RT_TIMING_GC_MARK          51
+#define RT_TIMING_GC_COMPACT       52
+#define RT_TIMING_GC_ROOTSET2      53
+#define RT_TIMING_GC_TOTAL         54
+
+#define RT_TIMING_N                55
 
 void rt_timing_gettime(struct timespec *ts);