ciObject.cpp revision 0
2N/A * Copyright 1999-2007 Sun Microsystems, Inc. All Rights Reserved. 2N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 2N/A * This code is free software; you can redistribute it and/or modify it 2N/A * under the terms of the GNU General Public License version 2 only, as 2N/A * published by the Free Software Foundation. 2N/A * This code is distributed in the hope that it will be useful, but WITHOUT 2N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 2N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 2N/A * version 2 for more details (a copy is included in the LICENSE file that 2N/A * accompanied this code). 2N/A * You should have received a copy of the GNU General Public License version 2N/A * 2 along with this work; if not, write to the Free Software Foundation, 2N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2N/A * CA 95054 USA or visit www.sun.com if you need additional information or 2N/A * have any questions. 2N/A#
include "incls/_precompiled.incl" 2N/A// This class represents an oop in the HotSpot virtual machine. 2N/A// Its subclasses are structured in a hierarchy which mirrors 2N/A// an aggregate of the VM's oop and klass hierarchies (see 2N/A// to a corresponding oop on the VM side and provides routines 2N/A// for accessing the information in its oop. By using the ciObject 2N/A// hierarchy for accessing oops in the VM, the compiler ensures 2N/A// that it is safe with respect to garbage collection; that is, 2N/A// GC and compilation can proceed independently without 2N/A// Within the VM, the oop and klass hierarchies are separate. 2N/A// The compiler interface does not preserve this separation -- 2N/A// the distinction between `klassOop' and `Klass' are not 2N/A// reflected in the interface and instead the Klass hierarchy 2N/A// is directly modeled as the subclasses of ciKlass. 2N/A// ------------------------------------------------------------------ 2N/A// ciObject::ciObject // ------------------------------------------------------------------ // ------------------------------------------------------------------ // Unloaded klass/method variant. `klass' is the klass of the unloaded // ------------------------------------------------------------------ // NULL variant. Used only by ciNullObject. // ------------------------------------------------------------------ // Get the ciKlass of this ciObject. // When both _klass and _handle are NULL, we are dealing // with the distinguished instance of ciNullObject. // No one should ask it for its klass. // ------------------------------------------------------------------ // Set the unique identity number of a ciObject. // ------------------------------------------------------------------ // Report the unique identity number of a ciObject. // ------------------------------------------------------------------ // Are two ciObjects equal? // ------------------------------------------------------------------ // A hash value for the convenience of compilers. // Implementation note: we use the address of the ciObject as the // basis for the hash. Use the _ident field, which is well-behaved. // ------------------------------------------------------------------ // The address which the compiler should embed into the // generated code to represent this oop. This address // is not the true address of the oop -- it will get patched // during nmethod creation. // Implementation note: we use the handle as the encoding. The // nmethod constructor resolves the handle and patches in the oop. // This method should be changed to return an generified address // to discourage use of the JNI handle. // ------------------------------------------------------------------ // ciObject::has_encoding // ------------------------------------------------------------------ // Print debugging output about this ciObject. // Implementation note: dispatch to the virtual print_impl behavior st->
print(
" ident=%d %s address=0x%x>",
ident(),
// ------------------------------------------------------------------ // Print debugging output about the oop this ciObject represents.