use of org.jikesrvm.adaptive.measurements.listeners.NullListener in project JikesRVM by JikesRVM.
the class RuntimeMeasurements method takeTimerSample.
/**
* Called from Thread.yieldpoint every time it is invoked due to
* a timer interrupt.
*
* @param whereFrom source of the yieldpoint (e.g. backedge)
* @param yieldpointServiceMethodFP the frame pointer of the service
* method that is responsible for handling the yieldpoint
*/
@Uninterruptible
public static void takeTimerSample(int whereFrom, Address yieldpointServiceMethodFP) {
// We use timer ticks as a rough approximation of time.
// TODO: kill controller clock in favor of reportedTimerTicks
// PNT: huh?
Controller.controllerClock++;
// method that took yieldpoint
Address ypTakenInFP = Magic.getCallerFramePointer(yieldpointServiceMethodFP);
// Get the cmid for the method in which the yieldpoint was taken.
int ypTakenInCMID = Magic.getCompiledMethodID(ypTakenInFP);
// Get the cmid for that method's caller.
Address ypTakenInCallerFP = Magic.getCallerFramePointer(ypTakenInFP);
int ypTakenInCallerCMID = Magic.getCompiledMethodID(ypTakenInCallerFP);
// Determine if ypTakenInCallerCMID corresponds to a real Java stackframe.
// If one of the following conditions is detected, set ypTakenInCallerCMID to -1
// Caller is out-of-line assembly (no RVMMethod object) or top-of-stack psuedo-frame
// Caller is a native method
CompiledMethod ypTakenInCM = CompiledMethods.getCompiledMethod(ypTakenInCMID);
if (ypTakenInCallerCMID == StackFrameLayout.getInvisibleMethodID() || ypTakenInCM.getMethod().getDeclaringClass().hasBridgeFromNativeAnnotation()) {
ypTakenInCallerCMID = -1;
}
// Notify all registered listeners
for (NullListener aNl : timerNullListeners) {
if (aNl.isActive()) {
aNl.update(whereFrom);
}
}
for (MethodListener aMl : timerMethodListeners) {
if (aMl.isActive()) {
aMl.update(ypTakenInCMID, ypTakenInCallerCMID, whereFrom);
}
}
if (ypTakenInCallerCMID != -1) {
for (ContextListener aCl : timerContextListeners) {
if (aCl.isActive()) {
aCl.update(ypTakenInFP, whereFrom);
}
}
}
}
Aggregations