--- old/src/share/vm/gc/g1/g1InCSetState.hpp 2015-12-04 15:40:32.232407313 +0100 +++ new/src/share/vm/gc/g1/g1InCSetState.hpp 2015-12-04 15:40:32.140403504 +0100 @@ -55,6 +55,7 @@ // this encoding allows us to use an > 0 check. // The other values are simply encoded in increasing generation order, which // makes getting the next generation fast by a simple increment. + Ext = -2, // Extension point Humongous = -1, // The region is humongous NotInCSet = 0, // The region is not in the collection set. Young = 1, // The region is in the collection set and a young region. @@ -76,10 +77,11 @@ bool is_humongous() const { return _value == Humongous; } bool is_young() const { return _value == Young; } bool is_old() const { return _value == Old; } + bool is_ext() const { return _value == Ext; } #ifdef ASSERT - bool is_default() const { return !is_in_cset_or_humongous(); } - bool is_valid() const { return (_value >= Humongous) && (_value < Num); } + bool is_default() const { return _value == NotInCSet; } + bool is_valid() const { return (_value >= Ext) && (_value < Num); } bool is_valid_gen() const { return (_value >= Young && _value <= Old); } #endif }; @@ -105,6 +107,12 @@ set_by_index(index, InCSetState::Humongous); } + void set_ext(uintptr_t index) { + assert(get_by_index(index).is_default(), + "State at index " INTPTR_FORMAT " should be default but is " CSETSTATE_FORMAT, index, get_by_index(index).value()); + set_by_index(index, InCSetState::Ext); + } + void clear_humongous(uintptr_t index) { set_by_index(index, InCSetState::NotInCSet); }