/*
* 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. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* 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.
*/
/*
* The Original Code is HAT. The Initial Developer of the
* Original Code is Bill Foote, with contributions from others
*/
/**
*
* @author Bill Foote
*/
// my id
private long id;
// my name
// These are JavaObjectRef before resolve
// non-static fields
// static fields
// my subclasses
// my instances
// Who I belong to. Set on resolve.
// Size of an instance, including VM overhead
private int instanceSize;
// Total number of fields including inherited ones
private int totalNumFields;
long signersId, long protDomainId,
int instanceSize) {
this.instanceSize = instanceSize;
}
long signersId, long protDomainId,
int instanceSize) {
}
return mySnapshot.getJavaLangClass();
}
public final int getIdentifierSize() {
return mySnapshot.getIdentifierSize();
}
public final int getMinimumObjectSize() {
return mySnapshot.getMinimumObjectSize();
}
if (mySnapshot != null) {
return;
}
if (superclass != null) {
}
}
return;
}
/**
* Resolve our superclass. This might be called well before
* all instances are available (like when reading deferred
* instances in a 1.2 dump file :-) Calling this is sufficient
* to be able to explore this class' fields.
*/
if (superclass == null) {
// We must be java.lang.Object, so we have no superclass.
} else {
superclass = null;
} else {
try {
} catch (ClassCastException ex) {
superclass = null;
}
}
}
}
public boolean isString() {
return mySnapshot.getJavaLangString() == this;
}
public boolean isClassLoader() {
}
/**
* Get a numbered field from this class
*/
}
return fields[i];
}
/**
* Get the total number of fields that are part of an instance of
* this class. That is, include superclasses.
*/
public int getNumFieldsForInstance() {
return totalNumFields;
}
/**
* Get a numbered field from all the fields that are part of instance
* of this class. That is, include superclasses.
*/
if (superclass != null) {
if (i < sc.totalNumFields) {
return sc.getFieldForInstance(i);
}
i -= sc.totalNumFields;
}
return getField(i);
}
/**
* Get the class responsible for field i, where i is a field number that
* could be passed into getFieldForInstance.
*
* @see JavaClass.getFieldForInstance()
*/
if (superclass != null) {
if (i < sc.totalNumFields) {
return sc.getClassForField(i);
}
}
return this;
}
public long getId() {
return id;
}
return name;
}
public boolean isArray() {
}
if (includeSubclasses) {
subclasses[i].getInstances(true));
}
return res;
} else {
}
}
/**
* @return a count of the instances of this class
*/
if (includeSubclasses) {
}
}
return result;
}
return subclasses;
}
/**
* This can only safely be called after resolve()
*/
return (JavaClass) superclass;
}
/**
* This can only safely be called after resolve()
*/
return loader;
}
/**
* This can only safely be called after resolve()
*/
public boolean isBootstrap() {
}
/**
* This can only safely be called after resolve()
*/
return signers;
}
/**
* This can only safely be called after resolve()
*/
return protectionDomain;
}
return fields;
}
/**
* Includes superclass fields
*/
addFields(v);
for (int i = 0; i < v.size(); i++) {
}
return result;
}
return statics;
}
// returns value of static field of given name
JavaStatic s = statics[i];
return s.getValue();
}
}
return null;
}
return "class " + name;
}
}
}
/**
* @return true iff a variable of type this is assignable from an instance
* of other
*/
if (this == other) {
return true;
return false;
} else {
// Trivial tail recursion: I have faith in javac.
}
}
/**
* Describe the reference that this thing has to target. This will only
* be called if target is in the array returned by getChildrenForRootset.
*/
if (f.hasId()) {
return "static field " + f.getName();
}
}
}
}
/**
* @return the size of an instance of this class. Gives 0 for an array
* type.
*/
public int getInstanceSize() {
}
/**
* @return The size of all instances of this class. Correctly handles
* arrays.
*/
public long getTotalInstanceSize() {
return count * instanceSize;
}
// array class and non-zero count, we have to
// get the size of each instance and sum it
long result = 0;
for (int i = 0; i < count; i++) {
}
return result;
}
/**
* @return the size of this object
*/
public int getSize() {
return 0;
} else {
return cl.getInstanceSize();
}
}
super.visitReferencedObjects(v);
if (other instanceof JavaHeapObject) {
}
other = getSigners();
if (other instanceof JavaHeapObject) {
}
other = getProtectionDomain();
if (other instanceof JavaHeapObject) {
}
if (other instanceof JavaHeapObject) {
}
}
}
}
// package-privates below this point
return mySnapshot.getReadBuffer();
}
}
}
}
}
}
return mySnapshot;
}
}
// Internals only below this point
if (superclass != null) {
}
v.addElement(fields[i]);
}
}
subclasses[i].addSubclassInstances(v);
}
}
}
}
}