Search in sources :

Example 1 with OutOfMemory

use of org.mmtk.harness.exception.OutOfMemory 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 OutOfMemory

use of org.mmtk.harness.exception.OutOfMemory 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

OutOfMemory (org.mmtk.harness.exception.OutOfMemory)2 ObjectValue (org.mmtk.harness.lang.runtime.ObjectValue)2 StackFrame (org.mmtk.harness.lang.runtime.StackFrame)2 ObjectReference (org.vmmagic.unboxed.ObjectReference)2