diff src/share/vm/ci/ciCallProfile.hpp @ 4137:04b9a2566eec

Merge with hsx23/hotspot.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sat, 17 Dec 2011 21:40:27 +0100
parents be4ca325525a c26de9aef2ed
children b8f261ba79c6
line wrap: on
line diff
--- a/src/share/vm/ci/ciCallProfile.hpp	Sat Dec 17 20:50:09 2011 +0100
+++ b/src/share/vm/ci/ciCallProfile.hpp	Sat Dec 17 21:40:27 2011 +0100
@@ -80,6 +80,17 @@
     assert(i < _limit, "out of Call Profile MorphismLimit");
     return _receiver[i];
   }
+
+  // Rescale the current profile based on the incoming scale
+  ciCallProfile rescale(double scale) {
+    assert(scale >= 0 && scale <= 1.0, "out of range");
+    ciCallProfile call = *this;
+    call._count = (int)(call._count * scale);
+    for (int i = 0; i < _morphism; i++) {
+      call._receiver_count[i] = (int)(call._receiver_count[i] * scale);
+    }
+    return call;
+  }
 };
 
 #endif // SHARE_VM_CI_CICALLPROFILE_HPP