changeset 809:6e2afda171db

6849716: BitMap - performance regression introduced with G1 Summary: make verification code visible only in debug builds Reviewed-by: iveresov, ysr, johnc, apetrusenko, tonyp
author jcoomes
date Thu, 11 Jun 2009 13:31:01 -0700
parents 353ba4575581
children 3104f76478ee 830ca2573896
files src/share/vm/includeDB_compiler1 src/share/vm/utilities/bitMap.cpp src/share/vm/utilities/bitMap.hpp src/share/vm/utilities/bitMap.inline.hpp src/share/vm/utilities/macros.hpp
diffstat 5 files changed, 19 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/includeDB_compiler1	Sun Jun 07 22:08:24 2009 -0700
+++ b/src/share/vm/includeDB_compiler1	Thu Jun 11 13:31:01 2009 -0700
@@ -387,7 +387,7 @@
 c1_ValueSet.cpp                         c1_ValueSet.hpp
 
 c1_ValueSet.hpp                         allocation.hpp
-c1_ValueSet.hpp                         bitMap.hpp
+c1_ValueSet.hpp                         bitMap.inline.hpp
 c1_ValueSet.hpp                         c1_Instruction.hpp
 
 c1_ValueStack.cpp                       c1_IR.hpp
--- a/src/share/vm/utilities/bitMap.cpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/src/share/vm/utilities/bitMap.cpp	Thu Jun 11 13:31:01 2009 -0700
@@ -41,19 +41,6 @@
   resize(size_in_bits, in_resource_area);
 }
 
-
-void BitMap::verify_index(idx_t index) const {
-    assert(index < _size, "BitMap index out of bounds");
-}
-
-void BitMap::verify_range(idx_t beg_index, idx_t end_index) const {
-#ifdef ASSERT
-    assert(beg_index <= end_index, "BitMap range error");
-    // Note that [0,0) and [size,size) are both valid ranges.
-    if (end_index != _size)  verify_index(end_index);
-#endif
-}
-
 void BitMap::resize(idx_t size_in_bits, bool in_resource_area) {
   assert(size_in_bits >= 0, "just checking");
   idx_t old_size_in_words = size_in_words();
--- a/src/share/vm/utilities/bitMap.hpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/src/share/vm/utilities/bitMap.hpp	Thu Jun 11 13:31:01 2009 -0700
@@ -93,10 +93,12 @@
   // The index of the first full word in a range.
   idx_t word_index_round_up(idx_t bit) const;
 
-  // Verification, statistics.
-  void verify_index(idx_t index) const;
-  void verify_range(idx_t beg_index, idx_t end_index) const;
+  // Verification.
+  inline void verify_index(idx_t index) const NOT_DEBUG_RETURN;
+  inline void verify_range(idx_t beg_index, idx_t end_index) const
+    NOT_DEBUG_RETURN;
 
+  // Statistics.
   static idx_t* _pop_count_table;
   static void init_pop_count_table();
   static idx_t num_set_bits(bm_word_t w);
@@ -287,7 +289,6 @@
 #endif
 };
 
-
 // Convenience class wrapping BitMap which provides multiple bits per slot.
 class BitMap2D VALUE_OBJ_CLASS_SPEC {
  public:
--- a/src/share/vm/utilities/bitMap.inline.hpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/src/share/vm/utilities/bitMap.inline.hpp	Thu Jun 11 13:31:01 2009 -0700
@@ -22,6 +22,17 @@
  *
  */
 
+#ifdef ASSERT
+inline void BitMap::verify_index(idx_t index) const {
+  assert(index < _size, "BitMap index out of bounds");
+}
+
+inline void BitMap::verify_range(idx_t beg_index, idx_t end_index) const {
+  assert(beg_index <= end_index, "BitMap range error");
+  // Note that [0,0) and [size,size) are both valid ranges.
+  if (end_index != _size) verify_index(end_index);
+}
+#endif // #ifdef ASSERT
 
 inline void BitMap::set_bit(idx_t bit) {
   verify_index(bit);
--- a/src/share/vm/utilities/macros.hpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/src/share/vm/utilities/macros.hpp	Thu Jun 11 13:31:01 2009 -0700
@@ -106,11 +106,13 @@
 #ifdef ASSERT
 #define DEBUG_ONLY(code) code
 #define NOT_DEBUG(code)
+#define NOT_DEBUG_RETURN  /*next token must be ;*/
 // Historical.
 #define debug_only(code) code
 #else // ASSERT
 #define DEBUG_ONLY(code)
 #define NOT_DEBUG(code) code
+#define NOT_DEBUG_RETURN {}
 #define debug_only(code)
 #endif // ASSERT