6849716: BitMap - performance regression introduced with G1
authorjcoomes
Thu, 11 Jun 2009 13:31:01 -0700
changeset 2998 b501bd305780
parent 2997 69cd0f7ac5d6
child 2999 d494b40e4a41
child 3000 bbce6052b595
6849716: BitMap - performance regression introduced with G1 Summary: make verification code visible only in debug builds Reviewed-by: iveresov, ysr, johnc, apetrusenko, tonyp
hotspot/src/share/vm/includeDB_compiler1
hotspot/src/share/vm/utilities/bitMap.cpp
hotspot/src/share/vm/utilities/bitMap.hpp
hotspot/src/share/vm/utilities/bitMap.inline.hpp
hotspot/src/share/vm/utilities/macros.hpp
--- a/hotspot/src/share/vm/includeDB_compiler1	Sun Jun 07 22:08:24 2009 -0700
+++ b/hotspot/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/hotspot/src/share/vm/utilities/bitMap.cpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/hotspot/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/hotspot/src/share/vm/utilities/bitMap.hpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/hotspot/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/hotspot/src/share/vm/utilities/bitMap.inline.hpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/hotspot/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/hotspot/src/share/vm/utilities/macros.hpp	Sun Jun 07 22:08:24 2009 -0700
+++ b/hotspot/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