--- old/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp 2019-05-10 10:58:30.136380273 -0400 +++ new/src/hotspot/share/gc/shenandoah/shenandoahHeapRegion.hpp 2019-05-10 10:58:29.826382291 -0400 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2018, Red Hat, Inc. All rights reserved. + * Copyright (c) 2013, 2019, Red Hat, Inc. All rights reserved. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as @@ -32,9 +32,11 @@ #include "utilities/sizes.hpp" class VMStructs; +class ShenandoahHeapRegionStateConstant; class ShenandoahHeapRegion : public ContiguousSpace { friend class VMStructs; + friend class ShenandoahHeapRegionStateConstant; private: /* Region state is described by a state machine. Transitions are guarded by @@ -115,9 +117,10 @@ _pinned, // region is pinned _pinned_cset, // region is pinned and in cset (evac failure path) _trash, // region contains only trash + _REGION_STATES_NUM, // last }; - const char* region_state_to_string(RegionState s) const { + static const char* region_state_to_string(RegionState s) { switch (s) { case _empty_uncommitted: return "Empty Uncommitted"; case _empty_committed: return "Empty Committed"; @@ -157,6 +160,10 @@ void report_illegal_transition(const char* method); public: + static const int region_states_num() { + return _REGION_STATES_NUM; + } + // Allowed transitions from the outside code: void make_regular_allocation(); void make_regular_bypass(); @@ -424,6 +431,8 @@ void oop_iterate_humongous(OopIterateClosure* cl); inline void internal_increase_live_data(size_t s); + + void set_state(RegionState to); }; #endif // SHARE_GC_SHENANDOAH_SHENANDOAHHEAPREGION_HPP