Search in sources :

Example 1 with J9JITHashTablePointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9JITHashTablePointer in project openj9 by eclipse.

the class JITLook method hash_jit_artifact_search.

public static J9JITExceptionTablePointer hash_jit_artifact_search(J9JITHashTablePointer table, UDATA searchValue) throws CorruptDataException {
    PointerPointer bucket;
    J9JITExceptionTablePointer entry;
    if (searchValue.gte(table.start()) && searchValue.lt(table.end())) {
        /* The search value is in this hash table */
        bucket = DETERMINE_BUCKET(searchValue, table.start(), table.buckets());
        if (bucket.at(0).notNull()) {
            /* The bucket for this search value is not empty */
            if (bucket.at(0).allBitsIn(1)) {
                // LOW_BIT_SET
                /* The bucket consists of a single low-tagged J9JITExceptionTable pointer */
                entry = J9JITExceptionTablePointer.cast(bucket.at(0));
            } else {
                /* The bucket consists of an array of J9JITExceptionTable pointers,
					 * the last of which is low-tagged */
                /* Search all but the last entry in the array */
                bucket = PointerPointer.cast(bucket.at(0));
                for (; ; bucket = bucket.add(1)) {
                    entry = J9JITExceptionTablePointer.cast(bucket.at(0));
                    if (entry.allBitsIn(1)) {
                        break;
                    }
                    if (searchValue.gte(entry.startPC()) && searchValue.lt(entry.endWarmPC()))
                        return entry;
                    if ((entry.startColdPC().longValue() != 0) && searchValue.gte(entry.startColdPC()) && searchValue.lt(entry.endPC()))
                        return entry;
                }
            }
            /* Search the last (or only) entry in the bucket, which is low-tagged */
            entry = J9JITExceptionTablePointer.cast(UDATA.cast(entry).bitAnd(new UDATA(1).bitNot()));
            if (searchValue.gte(entry.startPC()) && searchValue.lt(entry.endWarmPC()))
                return entry;
            if ((entry.startColdPC().longValue() != 0) && searchValue.gte(entry.startColdPC()) && searchValue.lt(entry.endPC()))
                return entry;
        }
    }
    return J9JITExceptionTablePointer.NULL;
}
Also used : UDATA(com.ibm.j9ddr.vm29.types.UDATA) PointerPointer(com.ibm.j9ddr.vm29.pointer.PointerPointer) J9JITExceptionTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer)

Example 2 with J9JITHashTablePointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9JITHashTablePointer in project openj9 by eclipse.

the class JITLook method jit_artifact_search.

public static J9JITExceptionTablePointer jit_artifact_search(J9AVLTreePointer tree, UDATA searchValue) throws CorruptDataException {
    /* find the right hash table to look in */
    AVLTree localTree = AVLTree.fromJ9AVLTreePointer(tree, new JITArtifactSearchCompare());
    J9JITHashTablePointer table = J9JITHashTablePointer.cast(localTree.search(searchValue));
    if (table.notNull()) {
        /* return the result of looking in the correct hash table */
        return hash_jit_artifact_search(table, searchValue);
    }
    return J9JITExceptionTablePointer.NULL;
}
Also used : J9JITHashTablePointer(com.ibm.j9ddr.vm29.pointer.generated.J9JITHashTablePointer)

Aggregations

PointerPointer (com.ibm.j9ddr.vm29.pointer.PointerPointer)1 J9JITExceptionTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer)1 J9JITHashTablePointer (com.ibm.j9ddr.vm29.pointer.generated.J9JITHashTablePointer)1 UDATA (com.ibm.j9ddr.vm29.types.UDATA)1