Merge
authorjmasa
Thu, 24 Jan 2013 06:04:43 -0800
changeset 15240 4aea0ffdd4ce
parent 15237 9dadd171eeb8 (current diff)
parent 15239 154bc4bda370 (diff)
child 15245 382a822442e3
Merge
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Tue Jan 22 11:54:16 2013 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.cpp	Thu Jan 24 06:04:43 2013 -0800
@@ -131,17 +131,23 @@
 
 #ifndef PRODUCT
 
+template <> const int WorkerDataArray<int>::_uninitialized = -1;
+template <> const double WorkerDataArray<double>::_uninitialized = -1.0;
+template <> const size_t WorkerDataArray<size_t>::_uninitialized = (size_t)-1;
+
 template <class T>
 void WorkerDataArray<T>::reset() {
   for (uint i = 0; i < _length; i++) {
-    _data[i] = (T)-1;
+    _data[i] = (T)_uninitialized;
   }
 }
 
 template <class T>
 void WorkerDataArray<T>::verify() {
   for (uint i = 0; i < _length; i++) {
-    assert(_data[i] >= (T)0, err_msg("Invalid data for worker %d", i));
+    assert(_data[i] != _uninitialized,
+        err_msg("Invalid data for worker " UINT32_FORMAT ", data: %lf, uninitialized: %lf",
+            i, (double)_data[i], (double)_uninitialized));
   }
 }
 
@@ -201,20 +207,20 @@
   _last_termination_attempts.verify();
   _last_gc_worker_end_times_ms.verify();
 
-    for (uint i = 0; i < _active_gc_threads; i++) {
-      double worker_time = _last_gc_worker_end_times_ms.get(i) - _last_gc_worker_start_times_ms.get(i);
-      _last_gc_worker_times_ms.set(i, worker_time);
+  for (uint i = 0; i < _active_gc_threads; i++) {
+    double worker_time = _last_gc_worker_end_times_ms.get(i) - _last_gc_worker_start_times_ms.get(i);
+    _last_gc_worker_times_ms.set(i, worker_time);
 
-      double worker_known_time = _last_ext_root_scan_times_ms.get(i) +
-        _last_satb_filtering_times_ms.get(i) +
-        _last_update_rs_times_ms.get(i) +
-        _last_scan_rs_times_ms.get(i) +
-        _last_obj_copy_times_ms.get(i) +
-        _last_termination_times_ms.get(i);
+    double worker_known_time = _last_ext_root_scan_times_ms.get(i) +
+      _last_satb_filtering_times_ms.get(i) +
+      _last_update_rs_times_ms.get(i) +
+      _last_scan_rs_times_ms.get(i) +
+      _last_obj_copy_times_ms.get(i) +
+      _last_termination_times_ms.get(i);
 
-      double worker_other_time = worker_time - worker_known_time;
-      _last_gc_worker_other_times_ms.set(i, worker_other_time);
-    }
+    double worker_other_time = worker_time - worker_known_time;
+    _last_gc_worker_other_times_ms.set(i, worker_other_time);
+  }
 
   _last_gc_worker_times_ms.verify();
   _last_gc_worker_other_times_ms.verify();
--- a/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp	Tue Jan 22 11:54:16 2013 -0800
+++ b/hotspot/src/share/vm/gc_implementation/g1/g1GCPhaseTimes.hpp	Thu Jan 24 06:04:43 2013 -0800
@@ -35,6 +35,8 @@
   const char* _print_format;
   bool        _print_sum;
 
+  NOT_PRODUCT(static const T _uninitialized;)
+
   // We are caching the sum and average to only have to calculate them once.
   // This is not done in an MT-safe way. It is intetened to allow single
   // threaded code to call sum() and average() multiple times in any order
--- a/hotspot/test/Makefile	Tue Jan 22 11:54:16 2013 -0800
+++ b/hotspot/test/Makefile	Thu Jan 24 06:04:43 2013 -0800
@@ -189,9 +189,9 @@
 	$(JTREG) -a -v:fail,error               \
           $(JTREG_KEY_OPTION)                   \
           $(EXTRA_JTREG_OPTIONS)                \
-          -r:$(ABS_TEST_OUTPUT_DIR)/JTreport    \
-          -w:$(ABS_TEST_OUTPUT_DIR)/JTwork      \
-          -jdk:$(PRODUCT_HOME)                  \
+          -r:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTreport    \
+          -w:$(shell $(GETMIXEDPATH) "$(ABS_TEST_OUTPUT_DIR)")/JTwork      \
+          -jdk:$(shell $(GETMIXEDPATH) "$(PRODUCT_HOME)")                  \
           $(JAVA_OPTIONS:%=-vmoption:%)         \
           $(JTREG_TESTDIRS)                     \
 	  || $(BUNDLE_UP_FAILED)