use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class StackTrace method recordFramesUninterruptible.
/**
* Walk the stack recording the stack frames encountered
* The stack being walked is our stack, so code is Uninterrupible to stop the
* stack moving.
*
* @param stackTraceThread the thread whose stack is walked
*/
@Uninterruptible
@NoInline
private void recordFramesUninterruptible(RVMThread stackTraceThread) {
int stackFrameCount = 0;
Address fp;
Address ip;
/* Stack trace for the thread */
if (stackTraceThread == RVMThread.getCurrentThread()) {
fp = Magic.getFramePointer();
} else {
AbstractRegisters contextRegisters = stackTraceThread.getContextRegisters();
fp = contextRegisters.getInnermostFramePointer();
}
ip = Magic.getReturnAddress(fp);
fp = Magic.getCallerFramePointer(fp);
while (Magic.getCallerFramePointer(fp).NE(StackFrameLayout.getStackFrameSentinelFP())) {
// VM.sysWriteln("at stackFrameCount = ",stackFrameCount);
int compiledMethodId = Magic.getCompiledMethodID(fp);
compiledMethods[stackFrameCount] = compiledMethodId;
if (compiledMethodId != StackFrameLayout.getInvisibleMethodID()) {
CompiledMethod compiledMethod = CompiledMethods.getCompiledMethod(compiledMethodId);
if (compiledMethod.getCompilerType() != CompiledMethod.TRAP) {
instructionOffsets[stackFrameCount] = compiledMethod.getInstructionOffset(ip).toInt();
if (compiledMethod.hasBridgeFromNativeAnnotation()) {
// VM.sysWriteln("native!");
// skip native frames, stopping at last native frame preceeding the
// Java To C transition frame
fp = RuntimeEntrypoints.unwindNativeStackFrame(fp);
}
} else {
// VM.sysWriteln("trap!");
}
} else {
// VM.sysWriteln("invisible method!");
}
stackFrameCount++;
ip = Magic.getReturnAddress(fp, stackTraceThread);
fp = Magic.getCallerFramePointer(fp);
}
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class PostThreadSwitch method postProcess.
/**
* This method must not be inlined to keep the correctness
* This method is called at the end of threadSwitch, the caller
* is threadSwitchFrom<...>
*
* @param myThread the currently running thread
*/
@NoInline
public static void postProcess(RVMThread myThread) {
/* We need to generate thread specific code and install new code.
* We have to make sure that no GC happens from here and before
* the new code get executed.
*/
// add branch instruction from CTR.
CodeArray bridge = myThread.bridgeInstructions;
Address bridgeaddr = Magic.objectAsAddress(bridge);
if (VM.TraceOnStackReplacement) {
VM.sysWriteln("osr post processing");
}
Offset offset = myThread.tsFPOffset.plus(STACKFRAME_RETURN_ADDRESS_OFFSET);
Magic.objectAsAddress(myThread.getStack()).store(bridgeaddr, offset);
myThread.tsFPOffset = Offset.zero();
myThread.isWaitingForOsr = false;
myThread.bridgeInstructions = null;
// no GC should happen until the glue code gets executed.
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class JNIHelpers method invokeWithDotDotVarArg.
/**
* Common code shared by the JNI functions Call<type>Method
* (virtual method invocation)
* @param obj the object instance
* @param methodID the method ID
* @param expectReturnType the return type for checking purpose
* @param skip4Args true if the calling JNI Function takes 4 args before the vararg
* false if the calling JNI Function takes 3 args before the vararg
* @return an object that may be the return object or a wrapper for the primitive return value
*/
@NoInline
public static Object invokeWithDotDotVarArg(Object obj, int methodID, TypeReference expectReturnType, boolean skip4Args) throws Exception {
MethodReference mr = MemberReference.getMethodRef(methodID);
if (VM.BuildForPower64ELF_ABI) {
Address varargAddress = pushVarArgToSpillArea(methodID, skip4Args);
Object[] argObjectArray = packageParameterFromVarArg(mr, varargAddress);
return callMethod(obj, mr, argObjectArray, expectReturnType, skip4Args);
} else {
if (VM.VerifyAssertions)
VM._assert(VM.BuildForSVR4ABI);
Address glueFP = Magic.getCallerFramePointer(Magic.getCallerFramePointer(Magic.getCallerFramePointer(Magic.getFramePointer())));
Object[] argObjectArray = packageParameterFromDotArgSVR4(mr, glueFP, skip4Args);
return callMethod(obj, mr, argObjectArray, expectReturnType, skip4Args);
}
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class DynamicLinkerHelper method getReceiverObject.
/**
* Reach up two stack frames into a frame that is compiled
* with the DynamicBridge register protocol and grab
* the receiver object of the invoke.
* <p>
* NOTE: assumes that caller has disabled GC.
*
* @return the receiver object for the method invocation
*/
@NoInline
public static Object getReceiverObject() {
Address callingFrame = Magic.getCallerFramePointer(Magic.getFramePointer());
callingFrame = Magic.getCallerFramePointer(callingFrame);
Address location = Address.zero();
if (0 < NUM_PARAMETER_GPRS) {
location = callingFrame.plus(T0_SAVE_OFFSET).loadAddress();
} else {
VM.sysFail("DynamicLinerHelper: assumes at least one param passed in registers");
}
return Magic.addressAsObject(location);
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class MemoryManager method newNonMovingShortArray.
/**
* Allocates a non moving short array.
*
* @param size The size of the array
* @return the new non moving short array
*/
@NoInline
@Interruptible
public static short[] newNonMovingShortArray(int size) {
if (!VM.runningVM) {
return new short[size];
}
RVMArray arrayType = RVMArray.ShortArray;
int headerSize = ObjectModel.computeArrayHeaderSize(arrayType);
int align = ObjectModel.getAlignment(arrayType);
int offset = ObjectModel.getOffsetForAlignment(arrayType, false);
int width = arrayType.getLogElementSize();
TIB arrayTib = arrayType.getTypeInformationBlock();
return (short[]) allocateArray(size, width, headerSize, arrayTib, Plan.ALLOC_NON_MOVING, align, offset, Plan.DEFAULT_SITE);
}
Aggregations