Exemple #1
0
FrameIndex
frame_find_or_create(jmethodID method, jlocation location)
{
    FrameIndex index;
    static FrameKey empty_key;
    FrameKey key;
    jboolean new_one;

    key          = empty_key;
    key.method   = method;
    key.location = location;
    new_one      = JNI_FALSE;
    index        = table_find_or_create_entry(gdata->frame_table,
                        &key, (int)sizeof(key), &new_one, NULL);
    if ( new_one ) {
        FrameInfo *info;

        info = get_info(index);
        info->lineno_state = LINENUM_UNINITIALIZED;
        if ( location < 0 ) {
            info->lineno_state = LINENUM_UNAVAILABLE;
        }
        info->serial_num = gdata->frame_serial_number_counter++;
    }
    return index;
}
ObjectIndex
object_new(SiteIndex site_index, jint size, ObjectKind kind, SerialNumber thread_serial_num)
{
    ObjectIndex index;
    ObjectKey   key;
    static ObjectKey empty_key;
    
    key            = empty_key;
    key.site_index = site_index;
    key.size       = size;
    key.kind       = kind;
    if ( gdata->heap_dump ) {
	static ObjectInfo empty_info;
	ObjectInfo i;

	i = empty_info;
	i.thread_serial_num = thread_serial_num;
        key.serial_num = gdata->object_serial_number_counter++;
	index = table_create_entry(gdata->object_table, 
			    &key, (int)sizeof(ObjectKey), &i);
    } else {
        key.serial_num = 
	     class_get_serial_number(site_get_class_index(site_index));
	index = table_find_or_create_entry(gdata->object_table, 
			    &key, (int)sizeof(ObjectKey), NULL, NULL);
    }
    site_update_stats(site_index, size, 1);
    return index;
}
Exemple #3
0
SiteIndex
site_find_or_create(ClassIndex cnum, TraceIndex trace_index)
{
    SiteIndex index;
    static SiteKey  empty_key;
    SiteKey   key;
    
    key = empty_key;
    HPROF_ASSERT(cnum!=0);
    HPROF_ASSERT(trace_index!=0);
    key.cnum        = cnum;
    key.trace_index = trace_index;
    index = table_find_or_create_entry(gdata->site_table, 
			    &key, (int)sizeof(key), NULL, NULL);
    return index;
}
Exemple #4
0
FrameIndex
frame_find_or_create(jmethodID method, jlocation location)
{
    static FrameKey empty_key;
    FrameKey key;
    static FrameInfo empty_info;
    FrameInfo info;
    
    key          = empty_key;
    key.method   = method;
    key.location = location;
    info         = empty_info;
    if ( location < 0 ) {
	info.lineno = -1;
    }
    return table_find_or_create_entry(gdata->frame_table, 
			&key, (int)sizeof(key), NULL, (void*)&info);
}
IoNameIndex
ioname_find_or_create(const char *name, jboolean *pnew_entry)
{
    return table_find_or_create_entry(gdata->ioname_table, 
			(void*)name, (int)strlen(name)+1, pnew_entry, NULL);
}
StringIndex
string_find_or_create(const char *str)
{
    return table_find_or_create_entry(gdata->string_table,
                (void*)str, (int)strlen(str)+1, NULL, NULL);
}