use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class BumpPointer method allocSlow.
/**
* Internal allocation slow path. This is called whenever the bump
* pointer reaches the internal limit. The code is forced out of
* line. If required we perform an external slow path take, which
* we inline into this method since this is already out of line.
*
* @param start The start address for the pending allocation
* @param end The end address for the pending allocation
* @param align The requested alignment
* @param offset The offset from the alignment
* @return The address of the first byte of the allocated region
*/
@NoInline
private Address allocSlow(Address start, Address end, int align, int offset) {
Address rtn = null;
Address card = null;
if (SUPPORT_CARD_SCANNING)
// round up
card = getCard(start.plus(CARD_MASK));
if (end.GT(limit)) {
/* external slow path */
rtn = allocSlowInline(end.diff(start).toInt(), align, offset);
if (SUPPORT_CARD_SCANNING && card.NE(getCard(rtn.plus(CARD_MASK))))
// round down
card = getCard(rtn);
} else {
/* internal slow path */
while (internalLimit.LE(end)) internalLimit = internalLimit.plus(STEP_SIZE);
if (internalLimit.GT(limit))
internalLimit = limit;
fillAlignmentGap(cursor, start);
cursor = end;
rtn = start;
}
if (SUPPORT_CARD_SCANNING && !rtn.isZero())
createCardAnchor(card, rtn, end.diff(start).toInt());
return rtn;
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class OnStackReplacementTrigger method trigger.
@NoInline
@Unpreemptible
public static void trigger(int ypTakenInCMID, Offset tsFromFPoff, Offset ypTakenFPoff, int whereFrom) {
RVMThread thread = RVMThread.getCurrentThread();
CompiledMethod ypTakenInCM = CompiledMethods.getCompiledMethod(ypTakenInCMID);
RVMMethod ypTakenInMethod = ypTakenInCM.getMethod();
boolean isInBootImage = ypTakenInMethod.getDeclaringClass().isInBootImage();
if (isInBootImage)
return;
OnStackReplacementEvent event = (OnStackReplacementEvent) thread.onStackReplacementEvent;
event.suspendedThread = thread;
event.whereFrom = whereFrom;
event.CMID = ypTakenInCMID;
event.tsFromFPoff = tsFromFPoff;
event.ypTakenFPoff = ypTakenFPoff;
thread.monitor().lockNoHandshake();
thread.requesting_osr = true;
thread.monitor().unlock();
Controller.osrOrganizer.activate();
// PNT: Assumes that OSR doesn't need access to our context regs
thread.monitor().lockNoHandshake();
while (!thread.osr_done) {
thread.monitor().waitWithHandshake();
}
thread.osr_done = false;
thread.monitor().unlock();
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class DefUse method computeDU.
/**
* Compute the register list and def-use lists for a method.
*
* @param ir the IR in question
*/
@NoInline
public static void computeDU(IR ir) {
// Clear old register list (if any)
clearDU(ir);
// Create register defList and useList
for (Instruction instr = ir.firstInstructionInCodeOrder(); instr != null; instr = instr.nextInstructionInCodeOrder()) {
Enumeration<Operand> defs = instr.getPureDefs();
Enumeration<Operand> uses = instr.getUses();
while (defs.hasMoreElements()) {
Operand op = defs.nextElement();
if (op instanceof RegisterOperand) {
RegisterOperand rop = (RegisterOperand) op;
recordDef(rop);
}
}
while (uses.hasMoreElements()) {
Operand op = uses.nextElement();
if (op instanceof RegisterOperand) {
RegisterOperand rop = (RegisterOperand) op;
recordUse(rop);
}
}
// for ( uses = ... )
}
// for ( instr = ... )
// Remove any symbloic registers with no uses/defs from
// the register pool. We'll waste analysis time keeping them around.
Register next;
for (Register reg = ir.regpool.getFirstSymbolicRegister(); reg != null; reg = next) {
next = reg.getNext();
if (reg.defList == null && reg.useList == null) {
if (DEBUG) {
VM.sysWriteln("Removing " + reg + " from the register pool");
}
ir.regpool.removeRegister(reg);
}
}
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class TraceInterface method skipOwnFramesAndDump.
@Override
@NoInline
// This can't be uninterruptible --- it is an IO routine
@Interruptible
public Address skipOwnFramesAndDump(ObjectReference typeRef) {
TIB tib = Magic.addressAsTIB(typeRef.toAddress());
RVMMethod m = null;
int bci = -1;
int compiledMethodID = 0;
Offset ipOffset = Offset.zero();
Address fp = Magic.getFramePointer();
Address ip = Magic.getReturnAddressUnchecked(fp);
fp = Magic.getCallerFramePointer(fp);
// This code borrows heavily from RVMThread.dumpStack
final Address STACKFRAME_SENTINEL_FP = StackFrameLayout.getStackFrameSentinelFP();
final int INVISIBLE_METHOD_ID = StackFrameLayout.getInvisibleMethodID();
while (Magic.getCallerFramePointer(fp).NE(STACKFRAME_SENTINEL_FP)) {
compiledMethodID = Magic.getCompiledMethodID(fp);
if (compiledMethodID != INVISIBLE_METHOD_ID) {
// normal java frame(s)
CompiledMethod compiledMethod = CompiledMethods.getCompiledMethod(compiledMethodID);
if (compiledMethod.getCompilerType() != CompiledMethod.TRAP) {
ipOffset = compiledMethod.getInstructionOffset(ip);
m = compiledMethod.getMethod();
if (VM.BuildForOptCompiler && compiledMethod.getCompilerType() == CompiledMethod.OPT) {
OptCompiledMethod optInfo = (OptCompiledMethod) compiledMethod;
/* Opt stack frames may contain multiple inlined methods. */
OptMachineCodeMap map = optInfo.getMCMap();
int iei = map.getInlineEncodingForMCOffset(ipOffset);
if (iei >= 0) {
int[] inlineEncoding = map.inlineEncoding;
boolean allocCall = true;
bci = map.getBytecodeIndexForMCOffset(ipOffset);
for (int j = iei; j >= 0 && allocCall; j = OptEncodedCallSiteTree.getParent(j, inlineEncoding)) {
int mid = OptEncodedCallSiteTree.getMethodID(j, inlineEncoding);
m = MemberReference.getMethodRef(mid).getResolvedMember();
if (!isAllocCall(m.getName().getBytes()))
allocCall = false;
if (j > 0)
bci = OptEncodedCallSiteTree.getByteCodeOffset(j, inlineEncoding);
}
if (!allocCall)
break;
}
} else {
if (!isAllocCall(m.getName().getBytes())) {
BaselineCompiledMethod baseInfo = (BaselineCompiledMethod) compiledMethod;
final int INSTRUCTION_WIDTH = ArchConstants.getInstructionWidth();
bci = baseInfo.findBytecodeIndexForInstruction(ipOffset.toWord().lsh(INSTRUCTION_WIDTH).toOffset());
break;
}
}
}
}
ip = Magic.getReturnAddressUnchecked(fp);
fp = Magic.getCallerFramePointer(fp);
}
if (m != null) {
int allocid = (((compiledMethodID & 0x0000ffff) << 15) ^ ((compiledMethodID & 0xffff0000) >> 16) ^ ipOffset.toInt()) & ~0x80000000;
/* Now print the location string. */
VM.sysWrite('\n');
VM.writeHex(allocid);
VM.sysWrite('-');
VM.sysWrite('>');
VM.sysWrite('[');
VM.writeHex(compiledMethodID);
VM.sysWrite(']');
m.getDeclaringClass().getDescriptor().sysWrite();
VM.sysWrite(':');
m.getName().sysWrite();
m.getDescriptor().sysWrite();
VM.sysWrite(':');
VM.writeHex(bci);
VM.sysWrite('\t');
RVMType type = tib.getType();
type.getDescriptor().sysWrite();
VM.sysWrite('\n');
}
return fp;
}
use of org.vmmagic.pragma.NoInline in project JikesRVM by JikesRVM.
the class VM method writeField.
/**
* Low level print of the {@link Atom} <code>s</code> to the console.
* Left-fill with enough spaces to print at least <code>fieldWidth</code>
* characters
* @param fieldWidth Minimum width to print.
* @param s The {@link Atom} to print.
*/
@NoInline
public static /* don't waste code space inlining these --dave */
void writeField(int fieldWidth, Atom s) {
int len = s.length();
while (fieldWidth > len++) write(" ");
write(s);
}
Aggregations