Search in sources :

Example 31 with ObjectReference

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();
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference)

Example 32 with ObjectReference

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);
    }
}
Also used : RVMMethod(org.jikesrvm.classloader.RVMMethod) ObjectReference(org.vmmagic.unboxed.ObjectReference)

Example 33 with ObjectReference

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();
}
Also used : Address(org.vmmagic.unboxed.Address) ObjectReference(org.vmmagic.unboxed.ObjectReference)

Example 34 with ObjectReference

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);
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference)

Example 35 with ObjectReference

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();
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference)

Aggregations

ObjectReference (org.vmmagic.unboxed.ObjectReference)74 Inline (org.vmmagic.pragma.Inline)35 Entrypoint (org.vmmagic.pragma.Entrypoint)33 Offset (org.vmmagic.unboxed.Offset)21 Address (org.vmmagic.unboxed.Address)12 StackFrame (org.mmtk.harness.lang.runtime.StackFrame)5 RVMType (org.jikesrvm.classloader.RVMType)3 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)2 OutOfMemory (org.mmtk.harness.exception.OutOfMemory)2 ObjectValue (org.mmtk.harness.lang.runtime.ObjectValue)2 CollectorContext (org.mmtk.plan.CollectorContext)2 Uninterruptible (org.vmmagic.pragma.Uninterruptible)2 ArrayDeque (java.util.ArrayDeque)1 HashSet (java.util.HashSet)1 AbstractRegisters (org.jikesrvm.architecture.AbstractRegisters)1 RVMMethod (org.jikesrvm.classloader.RVMMethod)1 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)1 TIB (org.jikesrvm.objectmodel.TIB)1 NoInline (org.vmmagic.pragma.NoInline)1