/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "memory/allocation.hpp"
//
// PSPromotionLAB is a parallel scavenge promotion lab. This class acts very
// much like a MutableSpace. We couldn't embed a MutableSpace, though, as
// it has a considerable number of asserts and invariants that are violated.
//
class ObjectStartArray;
protected:
enum LabState {
};
// The shared initialize code invokes this.
public:
// Filling and flushing.
virtual void flush();
// Accessors
// Returns a subregion containing all objects in this space.
// Boolean querries.
// Size computations. Sizes are in bytes.
};
public:
PSYoungPromotionLAB() { }
// Not MT safe
// Can't assert this, when young fills, we keep the LAB around, but flushed.
// assert(_state != flushed, "Sanity");
// The 'new_top>obj' check is needed to detect overflow of obj+size.
"checking alignment");
return obj;
}
return NULL;
}
};
private:
public:
void flush();
// Not MT safe
// Cannot test for this now that we're doing promotion failures
// assert(_state != flushed, "Sanity");
// The 'new_top>obj' check is needed to detect overflow of obj+size.
"checking alignment");
return obj;
}
return NULL;
}
};
#endif // SHARE_VM_GC_IMPLEMENTATION_PARALLELSCAVENGE_PSPROMOTIONLAB_HPP