use of com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer 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;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer 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;
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer in project openj9 by eclipse.
the class JitMetadataFromPcCommand method run.
public void run(String command, String[] args, Context context, PrintStream out) throws DDRInteractiveCommandException {
try {
UDATA searchValue = new UDATA(Long.decode(args[0]));
J9JavaVMPointer vm = J9RASHelper.getVM(DataType.getJ9RASPointer());
J9JITExceptionTablePointer metaData = JITLook.jit_artifact_search(vm.jitConfig().translationArtifacts(), searchValue);
if (!metaData.isNull()) {
dbgext_j9jitexceptiontable(out, metaData);
}
} catch (CorruptDataException e) {
throw new DDRInteractiveCommandException(e);
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer in project openj9 by eclipse.
the class DTFJContext method cacheJITMethodAddresses.
private static void cacheJITMethodAddresses() {
jitMethodCache = new HashMap<J9MethodPointer, List<J9JITExceptionTablePointer>>();
try {
J9MemorySegmentListPointer dataCacheList = getVm().jitConfig().dataCacheList();
J9MemorySegmentPointer dataCache = dataCacheList.nextSegment();
while (dataCache.notNull()) {
UDATA current = UDATA.cast(dataCache.heapBase());
UDATA end = UDATA.cast(dataCache.heapAlloc());
while (current.lt(end)) {
J9JITDataCacheHeaderPointer hdr = J9JITDataCacheHeaderPointer.cast(current);
if (hdr.type().longValue() == J9DataTypeExceptionInfo) {
J9JITExceptionTablePointer metaData = J9JITExceptionTablePointer.cast(current.add(J9JITDataCacheHeader.SIZEOF));
addMetaData(metaData);
}
current = current.add(hdr.size());
}
dataCache = dataCache.nextSegment();
}
} catch (CorruptDataException e) {
return;
}
}
use of com.ibm.j9ddr.vm29.pointer.generated.J9JITExceptionTablePointer in project openj9 by eclipse.
the class DTFJJavaMethod method getCompiledSections.
@SuppressWarnings("rawtypes")
public Iterator getCompiledSections() {
if (compiledSections == null) {
compiledSections = new ArrayList<Object>();
List<J9JITExceptionTablePointer> metaDatas = DTFJContext.getJITMetaData(j9ramMethod);
if (metaDatas != null) {
for (J9JITExceptionTablePointer metaData : metaDatas) {
// There is always a warm region
try {
long start = metaData.startPC().longValue();
long size = metaData.endWarmPC().longValue() - start;
String name = String.format("jit section (%s) at %s", metaData.getAddress(), start);
J9DDRImageSection is = DTFJContext.getImageSection(start, name);
is.setSize(size);
compiledSections.add(is);
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
compiledSections.add(cd);
}
// JEXTRACT never considered the cold region. Leading to results where JEXTRACT could report 1 section and DTFJ will report 2.
try {
long start = metaData.startColdPC().longValue();
if (start != 0) {
long size = metaData.endPC().longValue() - start;
String name = String.format("cold jit section (%s) at %s", metaData.getAddress(), start);
J9DDRImageSection is = DTFJContext.getImageSection(start, name);
is.setSize(size);
compiledSections.add(is);
}
} catch (Throwable t) {
CorruptData cd = J9DDRDTFJUtils.handleAsCorruptData(DTFJContext.getProcess(), t);
compiledSections.add(cd);
}
}
}
}
return compiledSections.iterator();
}
Aggregations