oopsHierarchy.hpp revision 2223
2223N/A * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1472N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 0N/A// This hierarchy is a representation hierarchy, i.e. if A is a superclass 0N/A// of B, A's representation is a prefix of B's representation. 0N/A// When CHECK_UNHANDLED_OOPS is defined, an "oop" is a class with a 0N/A// carefully chosen set of constructors and conversion operators to go 0N/A// to and from the underlying oopDesc pointer type. 0N/A// Because oop and its subclasses <type>Oop are class types, arbitrary 0N/A// conversions are not accepted by the compiler, and you may get a message 0N/A// about overloading ambiguity (between long and int is common when converting 0N/A// from a constant in 64 bit mode), or unable to convert from type to 'oop'. 0N/A// Applying a cast to one of these conversion operators first will get to the 0N/A// underlying oopDesc* type if appropriate. 0N/A// Converting NULL to oop to Handle implicit is no longer accepted by the 0N/A// compiler because there are too many steps in the conversion. Use Handle() 0N/A// instead, which generates less code anyway. 0N/A // friend class markOop; 0N/A bool operator==(
const oop o)
const {
return obj() == o.
obj(); }
0N/A bool operator==(
void *p)
const {
return obj() == p; }
0N/A bool operator!=(
const oop o)
const {
return obj() != o.
obj(); }
0N/A bool operator!=(
void *p)
const {
return obj() != p; }
0N/A bool operator!()
const {
return !
obj(); }
0N/A operator void* ()
const {
return (
void *)
obj(); }
0N/A // from parNewGeneration and other things that want to get to the end of 0N/A#
endif // CHECK_UNHANDLED_OOPS 0N/A// The klass hierarchy is separate from the oop hierarchy. 1879N/A#
endif // SHARE_VM_OOPS_OOPSHIERARCHY_HPP