use of org.jikesrvm.compilers.common.CompiledMethod in project JikesRVM by JikesRVM.
the class OptExecutionStateExtractor method walkOnStack.
/* walk on stack frame, print out methods
*/
private static void walkOnStack(byte[] stack, Offset fpOffset) {
int cmid = STACKFRAME_SENTINEL_FP.toInt();
do {
cmid = Magic.getIntAtOffset(stack, fpOffset.plus(STACKFRAME_METHOD_ID_OFFSET));
if (cmid == INVISIBLE_METHOD_ID) {
VM.sysWriteln(" invisible method ");
} else {
CompiledMethod cm = CompiledMethods.getCompiledMethod(cmid);
VM.sysWriteln(cm.getMethod().toString());
}
VM.disableGC();
Address callerfp = Magic.objectAsAddress(stack).loadAddress(fpOffset.plus(STACKFRAME_FRAME_POINTER_OFFSET));
fpOffset = callerfp.diff(Magic.objectAsAddress(stack));
VM.enableGC();
} while (cmid != STACKFRAME_SENTINEL_FP.toInt());
}
use of org.jikesrvm.compilers.common.CompiledMethod 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.jikesrvm.compilers.common.CompiledMethod in project JikesRVM by JikesRVM.
the class AINewHotEdgeEvent method process.
/**
* Called when the controller is ready to process this event.
* Simply passes itself to the recompilation strategy.
*/
@Override
public void process() {
CompiledMethod cmpMethod = getCompiledMethod();
Controller.recompilationStrategy.considerHotCallEdge(cmpMethod, this);
}
use of org.jikesrvm.compilers.common.CompiledMethod in project JikesRVM by JikesRVM.
the class ControllerMemory method requestedOSR.
/**
* @return {@code true} iff there is a plan to transition from Base to Opt for a
* given CMID
*
* @param cmid the compiled method's ID
*/
public static synchronized boolean requestedOSR(int cmid) {
CompiledMethod cm = CompiledMethods.getCompiledMethod(cmid);
// make sure that the cm in question is baseline-compiled
if (cm.getCompilerType() != CompiledMethod.BASELINE)
return false;
// OK; now check for an OSR plan
RVMMethod m = cm.getMethod();
if (m == null)
return false;
return planWithStatus(m, ControllerPlan.OSR_BASE_2_OPT);
}
use of org.jikesrvm.compilers.common.CompiledMethod in project JikesRVM by JikesRVM.
the class RVMClass method initialize.
/**
* {@inheritDoc}<p>
*
* Side effects: superclasses are initialized, static fields receive
* initial values.
*/
@Override
public synchronized void initialize() throws ExceptionInInitializerError {
if (isInitialized()) {
return;
}
if (state == CLASS_INITIALIZING) {
return;
}
if (state == CLASS_INITIALIZER_FAILED) {
throw new NoClassDefFoundError(this + " (initialization failure)");
}
if (VM.TraceClassLoading && VM.runningVM)
VM.sysWriteln("RVMClass: (begin) initialize " + this);
if (VM.VerifyAssertions)
VM._assert(state == CLASS_INSTANTIATED);
state = CLASS_INITIALIZING;
if (VM.verboseClassLoading)
VM.sysWriteln("[Initializing " + this + "]");
//
if (superClass != null) {
superClass.initialize();
}
//
if (classInitializerMethod != null) {
CompiledMethod cm = classInitializerMethod.getCurrentCompiledMethod();
while (cm == null) {
classInitializerMethod.compile();
cm = classInitializerMethod.getCurrentCompiledMethod();
}
if (VM.verboseClassLoading)
VM.sysWriteln("[Running static initializer for " + this + "]");
try {
Magic.invokeClassInitializer(cm.getEntryCodeArray());
} catch (Error e) {
state = CLASS_INITIALIZER_FAILED;
throw e;
} catch (Throwable t) {
ExceptionInInitializerError eieio = new ExceptionInInitializerError(t);
state = CLASS_INITIALIZER_FAILED;
throw eieio;
}
// <clinit> is no longer needed: reclaim space by removing references to it
classInitializerMethod.invalidateCompiledMethod(cm);
classInitializerMethod = null;
}
if (VM.BuildForOptCompiler) {
// report that a class is about to be marked initialized to
// the opt compiler so it can invalidate speculative CHA optimizations
// before an instance of this class could actually be created.
classLoadListener.classInitialized(this, false);
}
state = CLASS_INITIALIZED;
Callbacks.notifyClassInitialized(this);
markFinalFieldsAsLiterals();
if (VM.verboseClassLoading)
VM.sysWriteln("[Initialized " + this + "]");
if (VM.TraceClassLoading && VM.runningVM)
VM.sysWriteln("RVMClass: (end) initialize " + this);
}
Aggregations