Search in sources :

Example 6 with StackFrame

use of org.mmtk.harness.lang.runtime.StackFrame in project JikesRVM by JikesRVM.

the class BinaryOperation method exec.

@Override
public void exec(Env env) {
    StackFrame frame = env.top();
    setResult(frame, op.operate(frame.get(op1), frame.get(op2)));
}
Also used : StackFrame(org.mmtk.harness.lang.runtime.StackFrame)

Example 7 with StackFrame

use of org.mmtk.harness.lang.runtime.StackFrame in project JikesRVM by JikesRVM.

the class CallIntrinsicOp method exec.

@Override
public void exec(Env env) {
    StackFrame frame = env.top();
    Value[] actuals = getOperandValues(frame);
    if (hasResult) {
        setResult(frame, method.eval(env, actuals));
    } else {
        method.exec(env, actuals);
    }
}
Also used : StackFrame(org.mmtk.harness.lang.runtime.StackFrame) Value(org.mmtk.harness.lang.runtime.Value)

Example 8 with StackFrame

use of org.mmtk.harness.lang.runtime.StackFrame in project JikesRVM by JikesRVM.

the class Env method computeThreadRoots.

@Override
public void computeThreadRoots(TraceLocal trace) {
    int localCount = 0;
    for (StackFrame frame : stack) {
        localCount += frame.computeRoots(trace);
    }
    Clock.stop();
    Trace.trace(Item.ROOTS, "Locals: %d", localCount);
    Clock.start();
}
Also used : StackFrame(org.mmtk.harness.lang.runtime.StackFrame)

Example 9 with StackFrame

use of org.mmtk.harness.lang.runtime.StackFrame in project JikesRVM by JikesRVM.

the class Env method dumpThreadRoots.

/**
 * Print the thread roots and add them to a stack for processing.
 */
@Override
public Collection<ObjectReference> dumpThreadRoots(int width) {
    int frameId = 0;
    List<ObjectReference> roots = new ArrayList<ObjectReference>();
    for (StackFrame frame : stack) {
        System.err.printf("  Frame %5d [", frameId++);
        roots.addAll(frame.dumpRoots(width));
        System.err.println(" ]");
    }
    System.err.println();
    return roots;
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) StackFrame(org.mmtk.harness.lang.runtime.StackFrame) ArrayList(java.util.ArrayList)

Example 10 with StackFrame

use of org.mmtk.harness.lang.runtime.StackFrame in project JikesRVM by JikesRVM.

the class AllocOp method exec.

@Override
public void exec(Env env) {
    StackFrame frame = env.top();
    ObjectReference object;
    try {
        object = env.alloc(getRefCount(frame), getDataCount(frame), getDoubleAlign(frame), site);
    } catch (OutOfMemory e) {
        throw e;
    } catch (Exception e) {
        throw new RuntimeException("Error allocating object id:" + ObjectModel.lastObjectId() + " refs:" + getRefCount(frame) + " ints: " + getDataCount(frame) + " align:" + getDoubleAlign(frame) + " site:" + site, e);
    }
    setResult(frame, new ObjectValue(object));
    if (Harness.gcEveryAlloc()) {
        env.gc();
    }
}
Also used : OutOfMemory(org.mmtk.harness.exception.OutOfMemory) ObjectValue(org.mmtk.harness.lang.runtime.ObjectValue) ObjectReference(org.vmmagic.unboxed.ObjectReference) StackFrame(org.mmtk.harness.lang.runtime.StackFrame)

Aggregations

StackFrame (org.mmtk.harness.lang.runtime.StackFrame)11 ObjectReference (org.vmmagic.unboxed.ObjectReference)5 OutOfMemory (org.mmtk.harness.exception.OutOfMemory)2 ObjectValue (org.mmtk.harness.lang.runtime.ObjectValue)2 ArrayList (java.util.ArrayList)1 Value (org.mmtk.harness.lang.runtime.Value)1