/*
* 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
*/
/**
* Represents Java instance
*
* @author Bill Foote
*/
// JavaClass after resolve
/**
* Construct a new JavaObject.
*
* @param classID id of the class object
* @param offset The offset of field data
*/
super(offset);
}
return;
}
"adding fake class!");
int length;
try {
} catch (IOException exp) {
throw new RuntimeException(exp);
}
}
} else {
throw new InternalError("should not reach here");
}
// while resolving, parse fields in verbose mode.
// but, getFields calls parseFields in non-verbose mode
// to avoid printing warnings repeatedly.
parseFields(getValue(), true);
cl.addInstance(this);
}
/**
* Are we the same type as other? We are iff our clazz is the
* same type as other's.
*/
if (!(other instanceof JavaObject)) {
return false;
}
}
/**
* Return our JavaClass object. This may only be called after resolve.
*/
}
// pass false to verbose mode so that dereference
// warnings are not printed.
return parseFields(getValue(), false);
}
// returns the value of field of given name
return flds[i];
}
}
return null;
}
if (other instanceof JavaObject) {
}
}
super.visitReferencedObjects(v);
if (v.mightExclude()
getClazz().getFieldForInstance(i)))
{
// skip it
} else if (flds[i] instanceof JavaHeapObject) {
}
}
}
}
//
// REMIND: This introduces a dependency on the JDK
// implementation that is undesirable.
return false;
}
}
return true;
}
}
return false;
}
/**
* Describe the reference that this thing has to target. This will only
* be called if target is in the array returned by getChildrenForRootset.
*/
return "field " + f.getName();
}
}
}
if (value instanceof JavaValueArray) {
} else {
return "null";
}
} else {
return super.toString();
}
}
// Internals only below this point
/*
* Java instance record (HPROF_GC_INSTANCE_DUMP) looks as below:
*
* object ID
* stack trace serial number (int)
* class ID
* data length (int)
* byte[length]
*/
}
if (length == 0) {
return Snapshot.EMPTY_BYTE_ARRAY;
} else {
return res;
}
}
int fieldNo = 0;
// In the dump file, the fields are stored in this order:
// fields of most derived class (immediate class) are stored
// first and then the super class and so on. In this object,
// fields are stored in the reverse ("natural") order. i.e.,
// fields of most super class are stored first.
// target variable is used to compensate for the fact that
// the dump file starts field values from the leaf working
// upwards in the inheritance hierarchy, whereas JavaObject
// starts with the top of the inheritance hierarchy and works down.
int index = 0;
fieldNo = 0;
}
switch (sig) {
case 'L':
case '[': {
break;
}
case 'Z': {
index++;
break;
}
case 'B': {
index++;
break;
}
case 'S': {
index += 2;
break;
}
case 'C': {
index += 2;
break;
}
case 'I': {
index += 4;
break;
}
case 'J': {
index += 8;
break;
}
case 'F': {
index += 4;
break;
}
case 'D': {
index += 8;
break;
}
default:
}
}
return fieldValues;
}
}
}