2362N/A * Copyright (c) 2003, 2005, Oracle and/or its affiliates. All rights reserved. 0N/A * Redistribution and use in source and binary forms, with or without 0N/A * modification, are permitted provided that the following conditions 0N/A * - Redistributions of source code must retain the above copyright 0N/A * notice, this list of conditions and the following disclaimer. 0N/A * - Redistributions in binary form must reproduce the above copyright 0N/A * notice, this list of conditions and the following disclaimer in the 0N/A * documentation and/or other materials provided with the distribution. 2362N/A * - Neither the name of Oracle nor the names of its 0N/A * contributors may be used to endorse or promote products derived 0N/A * from this software without specific prior written permission. 0N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 0N/A * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 0N/A * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 0N/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 0N/A * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 0N/A * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 0N/A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 0N/A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 0N/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 0N/A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 0N/A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 4378N/A * This source code is provided to illustrate the usage of a given feature 4378N/A * or technique and has been deliberately simplified. Additional steps 4378N/A * required for a production-quality application, such as security checks, 4378N/A * input validation and proper error handling, might not be present in 0N/A * This table is used by the object table to store object reference 0N/A * and primitive data information obtained from iterations over the 0N/A * Most of these table entries have no Key, but the key is used to store 0N/A * the primitive array and primitive field jvalue. None of these entries 0N/A * are ever looked up, there will be no hash table, use of the 0N/A * LookupTable was just an easy way to handle a unbounded table of 0N/A * free this reference table after each heap dump or after processing the 0N/A * references and primitive data. 0N/A * The hprof format required this accumulation of all heap iteration 0N/A * references and primitive data from objects in order to compose an 0N/A * hprof records for it. 0N/A * This file contains detailed understandings of how an hprof CLASS 0N/A * and INSTANCE dump is constructed, most of this is derived from the 0N/A * original hprof code, but some has been derived by reading the HAT 0N/A * code that accepts this format. 0N/A/* The flavor of data being saved in the RefInfo */ 0N/A/* Reference information, object reference or primitive data information */ 0N/A unsigned flavor :
8;
/* INFO_*, flavor of RefInfo */ 0N/A unsigned primType :
8;
/* If primitive data involved, it's type */ 0N/A/* Private internal functions. */ 0N/A/* Get the RefInfo structure from an entry */ 0N/A/* Get a jvalue that was stored as the key. */ 0N/A/* Get size of a primitive type */ 0N/A/* Get a void* elements array that was stored as the key. */ 0N/A/* Dump a RefInfo* structure */ 0N/A ", object_index=0x%x" 0N/A/* Dump a RefIndex list */ 0N/A/* Dump information about a field and what ref data we had on it */ 0N/A/* Dump all the fields of interest */ 0N/A/* Verify field data */ 0N/A/* Fill in a field value, making sure the index is safe */ 0N/A/* Walk all references for an ObjectIndex and construct the hprof CLASS dump. */ 0N/A /* Get field information */ 0N/A /* Problems getting all the fields, can't trust field index values */ 0N/A /* Class with no references at all? (ok to be unprepared if list==0?) */ 0N/A /* It is assumed that the reason why we didn't get the fields 0N/A * was because the class is not prepared. 0N/A /* Why would an unprepared class contain references? */ 0N/A /* We use a Stack just because it will automatically expand as needed */ 0N/A /* Should never be seen on a class dump */ 0N/A /* Ignore, not needed */ 0N/A /* Should never see these */ 0N/A /* Get constant pool data if we have any */ 0N/A/* Walk all references for an ObjectIndex and construct the hprof INST dump. */ 0N/A /* Trouble getting all the fields, can't trust field index values */ 0N/A /* It is assumed that the reason why we didn't get the fields 0N/A * was because the class is not prepared. 0N/A /* Process reference objects, many not used right now. */ 0N/A /* Should never be seen on an instance dump */ 0N/A /* We get each object element one at a time. */ 0N/A /* Ignore, not needed */ 0N/A /* Should only be one, and it's handled below */ 0N/A /* We assert that nothing else was saved with this array */ 0N/A /* Do NOT free elements, it's a key in the table, leave it be */ 0N/A/* External interfaces. */ 0N/A/* Save away a reference to an object */ 0N/A/* Save away some primitive field data */ 0N/A/* Save away some primitive array data */