/*
* 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.
*/
/*
* This module tracks classes that have been prepared, so as to
* be able to compute which have been unloaded. On VM start-up
* all prepared classes are put in a table. As class prepare
* events come in they are added to the table. After an unload
* event or series of them, the VM can be asked for the list
* of classes; this list is compared against the table keep by
* this module, any classes no longer present are known to
* have been unloaded.
*
* For efficient access, classes are keep in a hash table.
* Each slot in the hash table has a linked list of KlassNode.
*
* Comparing current set of classes is compared with previous
* set by transferring all classes in the current set into
* a new table, any that remain in the old table have been
* unloaded.
*/
#include "util.h"
#include "bag.h"
#include "classTrack.h"
/* ClassTrack hash table slot count */
typedef struct KlassNode {
} KlassNode;
/*
* Hash table of prepared classes. Each entry is a pointer
* to a linked list of KlassNode.
*/
/*
* Return slot in hash table to use for this class.
*/
static jint
{
}
/*
* Transfer a node (which represents klass) from the current
* table to the new table.
*/
static void
/* Search the node list of the current table for klass */
/* Match found transfer node */
/* unlink from old list */
/* insert in new list */
return;
}
}
/* we haven't found the class, only unloads should have happenned,
* so the only reason a class should not have been found is
* that it is not prepared yet, in which case we don't want it.
* Asset that the above is true.
*/
/**** the HotSpot VM doesn't create prepare events for some internal classes ***
JDI_ASSERT_MSG((classStatus(klass) &
(JVMTI_CLASS_STATUS_PREPARED|JVMTI_CLASS_STATUS_ARRAY))==0,
classSignature(klass));
***/
}
/*
* Delete a hash table of classes.
* The signatures of classes in the table are returned.
*/
static struct bag *
{
if (signatures == NULL) {
}
char **sigSpot;
/* Add signature to the signature bag */
}
/* Free weak ref and the node itself */
}
}
return signatures;
}
/*
* Called after class unloads have occurred. Creates a new hash table
* of currently loaded prepared classes.
* The signatures of classes which were unloaded (not present in the
* new table) are returned.
*/
struct bag *
{
} else {
int i;
if ( error != JVMTI_ERROR_NONE ) {
} else {
/* Transfer each current class into the new table */
for (i=0; i<classCount; i++) {
}
/* Delete old table, install new one */
}
}
return unloadedSignatures;
}
/*
* Add a class to the prepared class hash table.
* Assumes no duplicates.
*/
void
{
/* Check this is not a duplicate */
JDI_ASSERT_FAILED("Attempting to insert duplicate class");
break;
}
}
}
}
if (error != JVMTI_ERROR_NONE) {
}
}
/* Insert the new node */
}
/*
* Called once to build the initial prepared class hash table.
*/
void
{
jint i;
if ( error == JVMTI_ERROR_NONE ) {
for (i=0; i<classCount; i++) {
/* We only want prepared classes and arrays */
}
}
} else {
}
} else {
}
}
void
classTrack_reset(void)
{
}