brutisso@6904: /* brutisso@6904: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. brutisso@6904: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. brutisso@6904: * brutisso@6904: * This code is free software; you can redistribute it and/or modify it brutisso@6904: * under the terms of the GNU General Public License version 2 only, as brutisso@6904: * published by the Free Software Foundation. brutisso@6904: * brutisso@6904: * This code is distributed in the hope that it will be useful, but WITHOUT brutisso@6904: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or brutisso@6904: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License brutisso@6904: * version 2 for more details (a copy is included in the LICENSE file that brutisso@6904: * accompanied this code). brutisso@6904: * brutisso@6904: * You should have received a copy of the GNU General Public License version brutisso@6904: * 2 along with this work; if not, write to the Free Software Foundation, brutisso@6904: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. brutisso@6904: * brutisso@6904: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA brutisso@6904: * or visit www.oracle.com if you need additional information or have any brutisso@6904: * questions. brutisso@6904: * brutisso@6904: */ brutisso@6904: brutisso@6904: #ifndef SHARE_VM_GC_IMPLEMENTATION_SHARED_GCID_HPP brutisso@6904: #define SHARE_VM_GC_IMPLEMENTATION_SHARED_GCID_HPP brutisso@6904: brutisso@6904: #include "memory/allocation.hpp" brutisso@6904: brutisso@6904: class GCId VALUE_OBJ_CLASS_SPEC { brutisso@6904: private: brutisso@6904: uint _id; brutisso@6904: GCId(uint id) : _id(id) {} brutisso@6904: GCId() { } // Unused brutisso@6904: brutisso@6904: static uint _next_id; brutisso@6904: static const uint UNDEFINED = (uint)-1; brutisso@6904: brutisso@6904: public: brutisso@6904: uint id() const { brutisso@6904: assert(_id != UNDEFINED, "Using undefined GC ID"); brutisso@6904: return _id; brutisso@6904: } brutisso@6904: bool is_undefined() const; brutisso@6904: brutisso@6904: static const GCId create(); brutisso@6904: static const GCId peek(); brutisso@6904: static const GCId undefined(); brutisso@6904: }; brutisso@6904: brutisso@6904: #endif // SHARE_VM_GC_IMPLEMENTATION_SHARED_GCID_HPP