/*
* 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.
*
*/
#ifndef SHARE_VM_OOPS_OOPSHIERARCHY_HPP
#define SHARE_VM_OOPS_OOPSHIERARCHY_HPP
#include "runtime/globals.hpp"
#include "utilities/globalDefinitions.hpp"
// OBJECT hierarchy
// This hierarchy is a representation hierarchy, i.e. if A is a superclass
// of B, A's representation is a prefix of B's representation.
// detector happy.
typedef void* OopOrNarrowOopStar;
#ifndef CHECK_UNHANDLED_OOPS
#else
// When CHECK_UNHANDLED_OOPS is defined, an "oop" is a class with a
// carefully chosen set of constructors and conversion operators to go
// to and from the underlying oopDesc pointer type.
//
// Because oop and its subclasses <type>Oop are class types, arbitrary
// conversions are not accepted by the compiler, and you may get a message
// about overloading ambiguity (between long and int is common when converting
// from a constant in 64 bit mode), or unable to convert from type to 'oop'.
// Applying a cast to one of these conversion operators first will get to the
// underlying oopDesc* type if appropriate.
// Converting NULL to oop to Handle implicit is no longer accepted by the
// compiler because there are too many steps in the conversion. Use Handle()
// instead, which generates less code anyway.
class Thread;
class PromotedObject;
class oop {
void register_oop();
void unregister_oop();
// friend class markOop;
public:
void set_obj(const void* p) {
raw_set_obj(p);
if (CheckUnhandledOops) register_oop();
}
#ifdef _LP64
#endif
~oop() {
if (CheckUnhandledOops) unregister_oop();
}
// General access
bool operator==(void *p) const { return obj() == p; }
bool operator!=(void *p) const { return obj() != p; }
bool operator!() const { return !obj(); }
// Cast
operator void* () const { return (void *)obj(); }
// from javaCalls.cpp
// from javaClasses.cpp
#ifndef _LP64
// from jvm.cpp
#endif
// from parNewGeneration and other things that want to get to the end of
// an oop for stuff (like constMethodKlass.cpp, objArrayKlass.cpp)
};
public: \
} \
}; \
#endif // CHECK_UNHANDLED_OOPS
// The klass hierarchy is separate from the oop hierarchy.
class Klass;
class instanceKlass;
class instanceMirrorKlass;
class instanceRefKlass;
class methodKlass;
class constMethodKlass;
class methodDataKlass;
class klassKlass;
class instanceKlassKlass;
class arrayKlassKlass;
class objArrayKlassKlass;
class typeArrayKlassKlass;
class arrayKlass;
class objArrayKlass;
class typeArrayKlass;
class constantPoolKlass;
class constantPoolCacheKlass;
class compiledICHolderKlass;
#endif // SHARE_VM_OOPS_OOPSHIERARCHY_HPP