use of org.jikesrvm.adaptive.measurements.instrumentation.MethodInvocationCounterData in project JikesRVM by JikesRVM.
the class InsertMethodInvocationCounter method perform.
/**
* Insert basic block counters
*
* @param ir the governing IR
*/
@Override
public final void perform(IR ir) {
// save volatile methods, or when instrumentation is disabled
if (!ir.method.isInterruptible() || !Instrumentation.instrumentationEnabled() || ir.method.getDeclaringClass().hasSaveVolatileAnnotation()) {
return;
}
BasicBlock firstBB = ir.cfg.entry();
MethodInvocationCounterData data = AOSDatabase.methodInvocationCounterData;
int cmid = ir.compiledMethod.getId();
// Create a dummy instruction that is later converted into an
// increment of the appropriate CounterArray element.
Instruction c = data.createEventCounterInstruction(cmid);
// Insert it at the beginning of the basic block
firstBB.prependInstructionRespectingPrologue(c);
}
Aggregations