use of org.jikesrvm.classloader.RVMMethod in project JikesRVM by JikesRVM.
the class PartialCallGraph method getCallTargets.
/**
* @param caller caller method
* @param bcIndex bytecode index in caller method
* @return the WeightedCallTargets currently associated with the
* given caller bytecodeIndex pair.
*/
public WeightedCallTargets getCallTargets(RVMMethod caller, int bcIndex) {
MethodReference callerRef = caller.getMemberRef().asMethodReference();
UnResolvedWeightedCallTargets unresolvedTargets = unresolvedCallGraph.get(new UnResolvedCallSite(callerRef, bcIndex));
if (unresolvedTargets != null) {
final RVMMethod fCaller = caller;
final int fBcIndex = bcIndex;
final PartialCallGraph pg = this;
unresolvedTargets.visitTargets(new UnResolvedWeightedCallTargets.Visitor() {
@Override
public void visit(MethodReference calleeRef, double weight) {
RVMMethod callee = calleeRef.getResolvedMember();
if (callee != null) {
pg.incrementEdge(fCaller, fBcIndex, callee, (float) weight);
}
}
});
}
return getCallTargets(new CallSite(caller, bcIndex));
}
use of org.jikesrvm.classloader.RVMMethod in project JikesRVM by JikesRVM.
the class OptCompiledMethod method isWithinUninterruptibleCode.
@Override
@Interruptible
public boolean isWithinUninterruptibleCode(Offset instructionOffset) {
NormalMethod realMethod = _mcMap.getMethodForMCOffset(instructionOffset);
// error message when no method is found.
if (realMethod == null) {
VM.sysWrite("Failing instruction offset: ");
VM.sysWrite(instructionOffset);
VM.sysWrite(" in method ");
RVMMethod thisMethod = this.getMethod();
VM.sysWrite(thisMethod.getName());
VM.sysWrite(" with descriptor ");
VM.sysWrite(thisMethod.getDescriptor());
VM.sysWrite(" declared by class with descriptor ");
VM.sysWriteln(thisMethod.getDeclaringClass().getDescriptor());
String msg = "Couldn't find a method for given instruction offset";
if (VM.VerifyAssertions) {
VM._assert(NOT_REACHED, msg);
} else {
VM.sysFail(msg);
}
}
return realMethod.isUninterruptible();
}
use of org.jikesrvm.classloader.RVMMethod in project JikesRVM by JikesRVM.
the class OptMachineCodeMap method getNonInlinedCallSites.
/**
* @return an arraylist of CallSite objects representing all non-inlined
* callsites in the method. Returns null if there are no such callsites.
*/
public ArrayList<CallSite> getNonInlinedCallSites() {
ArrayList<CallSite> ans = null;
if (MCInformation == null)
return ans;
for (int entry = 0; entry < MCInformation.length; ) {
int callInfo = getCallInfo(entry);
if (callInfo == IS_UNGUARDED_CALL) {
int bcIndex = getBytecodeIndex(entry);
if (bcIndex != -1) {
int iei = getInlineEncodingIndex(entry);
if (iei != -1) {
int mid = OptEncodedCallSiteTree.getMethodID(iei, inlineEncoding);
RVMMethod caller = MemberReference.getMemberRef(mid).asMethodReference().peekResolvedMethod();
if (caller != null) {
if (ans == null)
ans = new ArrayList<CallSite>();
ans.add(new CallSite(caller, bcIndex));
}
}
}
}
entry = nextEntry(entry);
}
return ans;
}
use of org.jikesrvm.classloader.RVMMethod in project JikesRVM by JikesRVM.
the class OptMachineCodeMap method printMCInformationEntry.
private void printMCInformationEntry(int entry, boolean DUMP_MAPS) {
if (DUMP_MAPS) {
String sep = "\tMC: ";
if (isBigEntry(entry))
sep = "B\tMC: ";
if (isHugeEntry(entry))
sep = "H\tMC: ";
int mcOffset = getMCOffset(entry);
VM.sysWrite(entry + sep + mcOffset + " (" + Integer.toHexString(mcOffset) + ")");
int bci = getBytecodeIndex(entry);
if (bci != -1) {
VM.sysWriteln();
VM.sysWrite("\tBCI: " + bci);
}
int iei = getInlineEncodingIndex(entry);
if (iei != -1) {
VM.sysWriteln();
VM.sysWrite("\tIEI: " + iei);
}
boolean first = true;
while (iei >= 0) {
int mid = OptEncodedCallSiteTree.getMethodID(iei, inlineEncoding);
RVMMethod meth = MemberReference.getMethodRef(mid).getResolvedMember();
if (first) {
first = false;
VM.sysWriteln();
VM.sysWrite("\tIn method " + meth + " at bytecode " + bci);
} else {
VM.sysWriteln();
VM.sysWrite("\tInlined into " + meth + " at bytecode " + bci);
}
if (iei > 0) {
bci = OptEncodedCallSiteTree.getByteCodeOffset(iei, inlineEncoding);
}
iei = OptEncodedCallSiteTree.getParent(iei, inlineEncoding);
}
if (getGCMapIndex(entry) != OptGCMap.NO_MAP_ENTRY) {
VM.sysWriteln();
VM.sysWrite("\tGC Map Idx: " + getGCMapIndex(entry) + " ");
OptGCMap.dumpMap(getGCMapIndex(entry), gcMaps);
} else {
VM.sysWriteln();
VM.sysWrite("\tno GC map");
}
VM.sysWriteln();
}
}
use of org.jikesrvm.classloader.RVMMethod in project JikesRVM by JikesRVM.
the class SpecializationDatabase method registerSpecialVersion.
/**
* Records a new specialized method in this database.
* Also remember that this method will need to be compiled later,
* at the next call to <code> doDeferredSpecializations() </code>
*
* @param spMethod the method to register
*/
static synchronized void registerSpecialVersion(SpecializedMethod spMethod) {
RVMMethod source = spMethod.getMethod();
MethodSet<RVMMethod> s = findOrCreateMethodSet(specialVersionsHash, source);
s.add(spMethod);
deferredMethods.add(spMethod);
}
Aggregations