use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class Traversal method doClosure.
/**
* Iterate over the heap depth-first, scanning objects until
* the mark stack is empty.
*/
private void doClosure() {
while (markStack.size() > 0) {
ObjectReference object = markStack.remove(markStack.size() - 1);
scan(object);
}
blackSet.clear();
markStack.clear();
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class ScanThread method printMethodHeader.
/**
* Print out the method header for the method associated with the
* current frame
*/
private void printMethodHeader() {
RVMMethod method = compiledMethod.getMethod();
Log.write("\n--- METHOD (");
Log.write(CompiledMethod.compilerTypeToString(compiledMethodType));
Log.write(") ");
if (method == null)
Log.write("null method");
else
printMethod(method);
Log.writeln();
Log.write("--- fp = ");
Log.write(fp);
if (compiledMethod.isCompiled()) {
ObjectReference codeBase = ObjectReference.fromObject(compiledMethod.getEntryCodeArray());
Log.write(" code base = ");
Log.write(codeBase);
Log.write(" code offset = ");
Log.writeln(ip.diff(codeBase.toAddress()));
Log.write(" line number = ");
Log.writeln(compiledMethod.findLineNumberForInstruction(ip.diff(codeBase.toAddress())));
} else {
Log.write(" Method is uncompiled - ip = ");
Log.writeln(ip);
}
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class ScanThread method dumpStackFrame.
/**
* Dump the contents of a stack frame. Attempts to interpret each
* word as an object reference
*
* @param verbosity The level of verbosity to be used when
* performing the scan.
*/
private void dumpStackFrame(int verbosity) {
Address start, end;
if (VM.BuildForIA32) {
if (prevFp.isZero()) {
start = fp.minus(20 * BYTES_IN_ADDRESS);
Log.writeln("--- 20 words of stack frame with fp = ", fp);
} else {
// start at callee fp
start = prevFp;
}
// end at fp
end = fp;
} else {
// start at fp
start = fp;
// stop at callers fp
end = fp.loadAddress();
}
for (Address loc = start; loc.LT(end); loc = loc.plus(BYTES_IN_ADDRESS)) {
Log.write(loc);
Log.write(" (");
Log.write(loc.diff(start));
Log.write("): ");
ObjectReference value = Selected.Plan.get().loadObjectReference(loc);
Log.write(value);
Log.write(" ");
Log.flush();
if (verbosity >= 4 && MemoryManager.objectInVM(value) && loc.NE(start) && loc.NE(end))
MemoryManager.dumpRef(value);
else
Log.writeln();
}
Log.writeln();
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class ScanThread method processFrameForCode.
/**
* Identify all pointers into code pointers associated with a frame.
* There are two cases to be considered: a) the instruction pointer
* associated with each frame (stored in the thread's metadata for
* the top frame and as a return address for all subsequent frames),
* and b) local variables on the stack which happen to be pointers
* to code.<p>
*
* FIXME: SB: Why is it that JNI frames are skipped when considering
* top of stack frames, while boot image frames are skipped when
* considering other frames. Shouldn't they both be considered in
* both cases?
*
* @param verbosity The level of verbosity to be used when
* performing the scan.
*/
private void processFrameForCode(int verbosity) {
/* get the code object associated with this frame */
ObjectReference code = ObjectReference.fromObject(compiledMethod.getEntryCodeArray());
pushFrameIP(code, verbosity);
scanFrameForCode(code);
}
use of org.vmmagic.unboxed.ObjectReference in project JikesRVM by JikesRVM.
the class ScanThread method dumpRef.
/**
* Print out information associated with a reference.
*
* @param refaddr The address of the reference in question.
* @param verbosity The level of verbosity to be used when
* performing the scan.
*/
private void dumpRef(Address refaddr, int verbosity) {
ObjectReference ref = refaddr.loadObjectReference();
VM.sysWrite(refaddr);
if (verbosity >= 5) {
VM.sysWrite(":");
MemoryManager.dumpRef(ref);
} else
VM.sysWriteln();
}
Aggregations