changeset 3577:b22382ddcb66

Merge
author dcubed
date Wed, 30 May 2012 06:56:23 -0700
parents e61e3c378ed4 d8fb2e80e074
children 7a8d3cd65621
files
diffstat 5 files changed, 28 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Thu May 24 13:48:46 2012 -0700
+++ b/.hgtags	Wed May 30 06:56:23 2012 -0700
@@ -231,3 +231,4 @@
 34fce1d343b0d9f5e1e5ea30d93e840d260f3dce hs23-b21
 1fcba869fe4a932616067e051565590ff375a63b hs23.2-b01
 b7ae1ee1d2e49bbfbcf35587cb51c04abf2710a2 hs23.2-b02
+e974e15945658e574e6c344c4a7ba225f5708c10 hs23.2-b03
--- a/make/hotspot_version	Thu May 24 13:48:46 2012 -0700
+++ b/make/hotspot_version	Wed May 30 06:56:23 2012 -0700
@@ -35,7 +35,7 @@
 
 HS_MAJOR_VER=23
 HS_MINOR_VER=2
-HS_BUILD_NUMBER=03
+HS_BUILD_NUMBER=04
 
 JDK_MAJOR_VER=1
 JDK_MINOR_VER=7
--- a/make/jprt.properties	Thu May 24 13:48:46 2012 -0700
+++ b/make/jprt.properties	Wed May 30 06:56:23 2012 -0700
@@ -133,7 +133,8 @@
     ${jprt.my.linux.x64}-{product|fastdebug}, \
     ${jprt.my.macosx.x64}-{product|fastdebug|debug}, \
     ${jprt.my.windows.i586}-{product|fastdebug|debug}, \
-    ${jprt.my.windows.x64}-{product|fastdebug|debug}
+    ${jprt.my.windows.x64}-{product|fastdebug|debug}, \
+    ${jprt.my.linux.armvfp}-{product|fastdebug}
 
 jprt.build.targets.open= \
     ${jprt.my.solaris.i586}-{productOpen}, \
--- a/src/share/vm/gc_implementation/shared/gcUtil.cpp	Thu May 24 13:48:46 2012 -0700
+++ b/src/share/vm/gc_implementation/shared/gcUtil.cpp	Wed May 30 06:56:23 2012 -0700
@@ -31,9 +31,15 @@
                                                         float average) {
   // We smooth the samples by not using weight() directly until we've
   // had enough data to make it meaningful. We'd like the first weight
-  // used to be 1, the second to be 1/2, etc until we have 100/weight
-  // samples.
-  unsigned count_weight = 100/count();
+  // used to be 1, the second to be 1/2, etc until we have
+  // OLD_THRESHOLD/weight samples.
+  unsigned count_weight = 0;
+
+  // Avoid division by zero if the counter wraps (7158457)
+  if (!is_old()) {
+    count_weight = OLD_THRESHOLD/count();
+  }
+
   unsigned adaptive_weight = (MAX2(weight(), count_weight));
 
   float new_avg = exp_avg(average, new_sample, adaptive_weight);
@@ -43,8 +49,6 @@
 
 void AdaptiveWeightedAverage::sample(float new_sample) {
   increment_count();
-  assert(count() != 0,
-         "Wraparound -- history would be incorrectly discarded");
 
   // Compute the new weighted average
   float new_avg = compute_adaptive_average(new_sample, average());
--- a/src/share/vm/gc_implementation/shared/gcUtil.hpp	Thu May 24 13:48:46 2012 -0700
+++ b/src/share/vm/gc_implementation/shared/gcUtil.hpp	Wed May 30 06:56:23 2012 -0700
@@ -50,11 +50,20 @@
   unsigned         _weight;         // The weight used to smooth the averages
                                     //   A higher weight favors the most
                                     //   recent data.
+  bool             _is_old;         // Has enough historical data
+
+  const static unsigned OLD_THRESHOLD = 100;
 
  protected:
   float            _last_sample;    // The last value sampled.
 
-  void  increment_count()       { _sample_count++;       }
+  void  increment_count() {
+    _sample_count++;
+    if (!_is_old && _sample_count > OLD_THRESHOLD) {
+      _is_old = true;
+    }
+  }
+
   void  set_average(float avg)  { _average = avg;        }
 
   // Helper function, computes an adaptive weighted average
@@ -64,13 +73,15 @@
  public:
   // Input weight must be between 0 and 100
   AdaptiveWeightedAverage(unsigned weight, float avg = 0.0) :
-    _average(avg), _sample_count(0), _weight(weight), _last_sample(0.0) {
+    _average(avg), _sample_count(0), _weight(weight), _last_sample(0.0),
+    _is_old(false) {
   }
 
   void clear() {
     _average = 0;
     _sample_count = 0;
     _last_sample = 0;
+    _is_old = false;
   }
 
   // Useful for modifying static structures after startup.
@@ -84,7 +95,8 @@
   float    average() const       { return _average;       }
   unsigned weight()  const       { return _weight;        }
   unsigned count()   const       { return _sample_count;  }
-  float    last_sample() const   { return _last_sample; }
+  float    last_sample() const   { return _last_sample;   }
+  bool     is_old()  const       { return _is_old;        }
 
   // Update data with a new sample.
   void sample(float new_sample);