Search in sources :

Example 1 with StackFrame

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

the class AllocUserOp method exec.

@Override
public void exec(Env env) {
    StackFrame frame = env.top();
    ObjectReference object;
    try {
        object = env.alloc(refCount, dataCount, getDoubleAlign(frame), site);
    } catch (OutOfMemory e) {
        throw e;
    } catch (Exception e) {
        throw new RuntimeException("Error allocating object id:" + ObjectModel.lastObjectId() + " refs:" + refCount + " ints: " + dataCount + " 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)

Example 2 with StackFrame

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

the class StoreFieldOp method exec.

@Override
public void exec(Env env) {
    Clock.assertStarted();
    StackFrame frame = env.top();
    int fieldIndex = getIndex(frame);
    ObjectReference object = getObjectObj(frame);
    if (fieldType == Type.INT) {
        env.storeDataField(object, fieldIndex, getValInt(frame));
    } else if (fieldType == Type.OBJECT) {
        env.storeReferenceField(object, fieldIndex, getValObject(frame));
    }
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) StackFrame(org.mmtk.harness.lang.runtime.StackFrame)

Example 3 with StackFrame

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

the class StoreFixedFieldOp method exec.

@Override
public void exec(Env env) {
    StackFrame frame = env.top();
    ObjectReference object = getObjectObj(frame);
    if (fieldType == Type.INT) {
        env.storeDataField(object, index, getValInt(frame));
    } else if (fieldType == Type.OBJECT) {
        env.storeReferenceField(object, index, getValObject(frame));
    }
}
Also used : ObjectReference(org.vmmagic.unboxed.ObjectReference) StackFrame(org.mmtk.harness.lang.runtime.StackFrame)

Example 4 with StackFrame

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

the class StoreLocal method exec.

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

Example 5 with StackFrame

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

the class UnaryOperation method exec.

@Override
public void exec(Env env) {
    StackFrame frame = env.top();
    setResult(frame, op.operate(frame.get(operand)));
}
Also used : 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