hprof_tag.c
/* Tag a jclass jobject if it hasn't been tagged. */
Tag a jclass jobject if it hasn't been tagged.
Tag a jclass jobject if it hasn ' t been tagged .
void
tag_class(JNIEnv *env, jclass klass, ClassIndex cnum,
                SerialNumber thread_serial_num, SiteIndex site_index)
{
    ObjectIndex object_index;
    object_index = class_get_object_index(cnum);
    if ( object_index == 0 ) {
        jint        size;
        jlong        tag;
        HPROF_ASSERT(site_index!=0);
        size =  gdata->system_class_size;
        if ( size == 0 ) {
            size  = (jint)getObjectSize(klass);
            gdata->system_class_size = size;
        }
        tag = getTag(klass);
        if ( tag == (jlong)0 ) {
            object_index = object_new(site_index, size, OBJECT_CLASS,
                                        thread_serial_num);
            tag = tag_create(object_index);
            setTag(klass, tag);
        } else {
            object_index = tag_extract(tag);
        }
        class_set_object_index(cnum, object_index);
    }
}
void tag_class ( JNIEnv * env , jclass klass , ClassIndex cnum , SerialNumber thread_serial_num , SiteIndex site_index ) { ObjectIndex object_index ; object_index = class_get_object_index ( cnum ) ; if ( object_index == 0 ) { jint size ; jlong tag ; HPROF_ASSERT ( site_index != 0 ) ; size = gdata -> system_class_size ; if ( size == 0 ) { size = ( jint ) getObjectSize ( klass ) ; gdata -> system_class_size = size ; } tag = getTag ( klass ) ; if ( tag == ( jlong ) 0 ) { object_index = object_new ( site_index , size , OBJECT_CLASS , thread_serial_num ) ; tag = tag_create ( object_index ) ; setTag ( klass , tag ) ; } else { object_index = tag_extract ( tag ) ; } class_set_object_index ( cnum , object_index ) ; } }
Tag a jclass jobject if it hasn't been tagged.
Tag a jclass jobject if it hasn ' t been tagged .
/* If the ClassIndex has an ObjectIndex, then we have tagged it. */ /* If we don't know the size of a java.lang.Class object, get it */ /* Tag this java.lang.Class object if it hasn't been already */ /* New object for this site. */ /* Create and set the tag. */ /* Get the ObjectIndex from the tag. */ /* Record this object index in the Class table */