* 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
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 $
*/
#include "vmcore/loader.h"
#include "vmcore/options.h"
+#include "vmcore/rt-timing.h"
/* global variables ***********************************************************/
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. */
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;
}
#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 ***********************************************************/
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);
final_register(p, finalizer);
}
+ RT_TIMING_GET_TIME(time_end);
+ RT_TIMING_TIME_DIFF(time_start, time_end, RT_TIMING_GC_ALLOC);
+
return p;
}
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 $
*/
{ 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" },
#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);