changeset 10618:72d0ea03635b

Delegate GC counter from HotSpot to Graal for tracing purposes
author Christos Kotselidis <christos.kotselidis@oracle.com>
date Sun, 07 Jul 2013 17:09:19 +0200
parents 88fa00e79d4a
children 2fdd0e263160
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java src/share/vm/gc_interface/collectedHeap.hpp src/share/vm/graal/graalCompilerToVM.cpp
diffstat 4 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Sun Jul 07 17:02:15 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotVMConfig.java	Sun Jul 07 17:09:19 2013 +0200
@@ -50,6 +50,7 @@
     public boolean usePopCountInstruction;
     public boolean useAESIntrinsics;
     public boolean useG1GC;
+    public long gcTotalCollectionsAddress;
 
     // Compressed Oops related values.
     public boolean useCompressedOops;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java	Sun Jul 07 17:02:15 2013 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/HotSpotReplacementsUtil.java	Sun Jul 07 17:09:19 2013 +0200
@@ -692,4 +692,9 @@
     public static int verifiedEntryPointOffset() {
         return config().nmethodEntryOffset;
     }
+
+    @Fold
+    public static long gcTotalCollectionsAddress() {
+        return config().gcTotalCollectionsAddress;
+    }
 }
--- a/src/share/vm/gc_interface/collectedHeap.hpp	Sun Jul 07 17:02:15 2013 +0200
+++ b/src/share/vm/gc_interface/collectedHeap.hpp	Sun Jul 07 17:09:19 2013 +0200
@@ -490,7 +490,9 @@
   // Total number of GC collections (started)
   unsigned int total_collections() const { return _total_collections; }
   unsigned int total_full_collections() const { return _total_full_collections;}
-
+#ifdef GRAAL
+  void* total_collections_address() { return &_total_collections;}
+#endif
   // Increment total number of GC collections (started)
   // Should be protected but used by PSMarkSweep - cleanup for 1.4.2
   void increment_total_collections(bool full = false) {
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Sun Jul 07 17:02:15 2013 +0200
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Sun Jul 07 17:09:19 2013 +0200
@@ -907,6 +907,7 @@
   set_int("g1SATBQueueBufferOffset", in_bytes(JavaThread::satb_mark_queue_offset() + PtrQueue::byte_offset_of_buf()));
   set_address("writeBarrierPreAddress", GraalRuntime::write_barrier_pre);
   set_address("writeBarrierPostAddress", GraalRuntime::write_barrier_post);
+  set_address("gcTotalCollectionsAddress", (jlong)(address)(Universe::heap()->total_collections_address()));
 
   BarrierSet* bs = Universe::heap()->barrier_set();
   switch (bs->kind()) {