< prev index next >

src/share/vm/gc/g1/g1ConcurrentMark.cpp

Print this page
rev 10742 : Make fields used in lock-free algorithms volatile


1906       // we succeeded
1907       HeapWord*   bottom        = curr_region->bottom();
1908       HeapWord*   limit         = curr_region->next_top_at_mark_start();
1909 
1910       // notice that _finger == end cannot be guaranteed here since,
1911       // someone else might have moved the finger even further
1912       assert(_finger >= end, "the finger should have moved forward");
1913 
1914       if (limit > bottom) {
1915         return curr_region;
1916       } else {
1917         assert(limit == bottom,
1918                "the region limit should be at bottom");
1919         // we return NULL and the caller should try calling
1920         // claim_region() again.
1921         return NULL;
1922       }
1923     } else {
1924       assert(_finger > finger, "the finger should have moved forward");
1925       // read it again
1926       finger = _finger;
1927     }
1928   }
1929 
1930   return NULL;
1931 }
1932 
1933 #ifndef PRODUCT
1934 class VerifyNoCSetOops VALUE_OBJ_CLASS_SPEC {
1935 private:
1936   G1CollectedHeap* _g1h;
1937   const char* _phase;
1938   int _info;
1939 
1940 public:
1941   VerifyNoCSetOops(const char* phase, int info = -1) :
1942     _g1h(G1CollectedHeap::heap()),
1943     _phase(phase),
1944     _info(info)
1945   { }
1946 




1906       // we succeeded
1907       HeapWord*   bottom        = curr_region->bottom();
1908       HeapWord*   limit         = curr_region->next_top_at_mark_start();
1909 
1910       // notice that _finger == end cannot be guaranteed here since,
1911       // someone else might have moved the finger even further
1912       assert(_finger >= end, "the finger should have moved forward");
1913 
1914       if (limit > bottom) {
1915         return curr_region;
1916       } else {
1917         assert(limit == bottom,
1918                "the region limit should be at bottom");
1919         // we return NULL and the caller should try calling
1920         // claim_region() again.
1921         return NULL;
1922       }
1923     } else {
1924       assert(_finger > finger, "the finger should have moved forward");
1925       // read it again
1926       finger = res;
1927     }
1928   }
1929 
1930   return NULL;
1931 }
1932 
1933 #ifndef PRODUCT
1934 class VerifyNoCSetOops VALUE_OBJ_CLASS_SPEC {
1935 private:
1936   G1CollectedHeap* _g1h;
1937   const char* _phase;
1938   int _info;
1939 
1940 public:
1941   VerifyNoCSetOops(const char* phase, int info = -1) :
1942     _g1h(G1CollectedHeap::heap()),
1943     _phase(phase),
1944     _info(info)
1945   { }
1946 


< prev index next >