use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class JNIExceptionDeliverer method unwindStackFrame.
/**
* Unwind registers/stack through JNI method
* @see org.jikesrvm.runtime.ExceptionDeliverer#unwindStackFrame(CompiledMethod, AbstractRegisters)
*/
@Uninterruptible
@Override
public void unwindStackFrame(CompiledMethod compiledMethod, AbstractRegisters registers) {
Address fp = registers.getInnermostFramePointer();
// Restore nonvolatile registers used by the JNI compiler
registers.getGPRs().set(GPR.EDI.value(), fp.plus(JNICompiler.EDI_SAVE_OFFSET).loadWord());
registers.getGPRs().set(GPR.EBX.value(), fp.plus(JNICompiler.EBX_SAVE_OFFSET).loadWord());
registers.getGPRs().set(GPR.EBP.value(), fp.plus(JNICompiler.EBP_SAVE_OFFSET).loadWord());
registers.unwindStackFrame();
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class Registers method adjustESP.
/**
* A thread's stack has been moved or resized.
* Adjust the ESP register to reflect new position.
*
* @param delta The displacement to be applied
* @param traceAdjustments Log all adjustments to stderr if true
*/
@Uninterruptible
@Override
public void adjustESP(Offset delta, boolean traceAdjustments) {
Word old = getGPRs().get(ESP.value());
getGPRs().set(ESP.value(), old.plus(delta));
if (traceAdjustments) {
VM.sysWrite(" esp =");
VM.sysWrite(getGPRs().get(ESP.value()));
}
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class DebugUtil method validRef.
@Uninterruptible
public static boolean validRef(ObjectReference ref) {
if (ref.isNull())
return true;
if (!Space.isMappedObject(ref)) {
VM.sysWrite("validRef: REF outside heap, ref = ");
VM.sysWrite(ref);
VM.sysWriteln();
Space.printVMMap();
return false;
}
if (MOVES_OBJECTS) {
/*
TODO: Work out how to check if forwarded
if (Plan.isForwardedOrBeingForwarded(ref)) {
// TODO: actually follow forwarding pointer
// (need to bound recursion when things are broken!!)
return true;
}
*/
}
TIB tib = ObjectModel.getTIB(ref);
Address tibAddr = Magic.objectAsAddress(tib);
if (!Space.isMappedObject(ObjectReference.fromObject(tib))) {
VM.sysWrite("validRef: TIB outside heap, ref = ");
VM.sysWrite(ref);
VM.sysWrite(" tib = ");
VM.sysWrite(tibAddr);
VM.sysWriteln();
ObjectModel.dumpHeader(ref);
return false;
}
if (tibAddr.isZero()) {
VM.sysWrite("validRef: TIB is Zero! ");
VM.sysWrite(ref);
VM.sysWriteln();
ObjectModel.dumpHeader(ref);
return false;
}
if (tib.length() == 0) {
VM.sysWrite("validRef: TIB length zero, ref = ");
VM.sysWrite(ref);
VM.sysWrite(" tib = ");
VM.sysWrite(tibAddr);
VM.sysWriteln();
ObjectModel.dumpHeader(ref);
return false;
}
ObjectReference type = ObjectReference.fromObject(tib.getType());
if (!validType(type)) {
VM.sysWrite("validRef: invalid TYPE, ref = ");
VM.sysWrite(ref);
VM.sysWrite(" tib = ");
VM.sysWrite(Magic.objectAsAddress(tib));
VM.sysWrite(" type = ");
VM.sysWrite(type);
VM.sysWriteln();
ObjectModel.dumpHeader(ref);
return false;
}
return true;
}
use of org.vmmagic.pragma.Uninterruptible in project JikesRVM by JikesRVM.
the class JNIEnvironment method dumpJniRefsStack.
/**
* Dump the JNIRefs stack to the sysWrite stream
*/
@Uninterruptible
public void dumpJniRefsStack() {
int jniRefOffset = JNIRefsTop;
VM.sysWriteln();
VM.sysWriteln("* * dump of JNIEnvironment JniRefs Stack * *");
VM.sysWrite("* JNIRefs = ");
VM.sysWrite(Magic.objectAsAddress(JNIRefs));
VM.sysWrite(" * JNIRefsTop = ");
VM.sysWrite(JNIRefsTop);
VM.sysWrite(" * JNIRefsSavedFP = ");
VM.sysWrite(JNIRefsSavedFP);
VM.sysWriteln(".");
VM.sysWriteln("*");
while (jniRefOffset >= 0) {
VM.sysWrite(jniRefOffset);
VM.sysWrite(" ");
VM.sysWrite(Magic.objectAsAddress(JNIRefs).plus(jniRefOffset));
VM.sysWrite(" ");
MemoryManager.dumpRef(JNIRefs.get(jniRefOffset >> LOG_BYTES_IN_ADDRESS).toObjectReference());
jniRefOffset -= BYTES_IN_ADDRESS;
}
VM.sysWriteln();
VM.sysWriteln("* * end of dump * *");
}
Aggregations