本文整理匯總了Java中jdk.vm.ci.code.CodeCacheProvider.getTarget方法的典型用法代碼示例。如果您正苦於以下問題:Java CodeCacheProvider.getTarget方法的具體用法?Java CodeCacheProvider.getTarget怎麽用?Java CodeCacheProvider.getTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類jdk.vm.ci.code.CodeCacheProvider
的用法示例。
在下文中一共展示了CodeCacheProvider.getTarget方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: disassemble
import jdk.vm.ci.code.CodeCacheProvider; //導入方法依賴的package包/類
private static String disassemble(CodeCacheProvider codeCache, CompilationResult compResult, InstalledCode installedCode) {
TargetDescription target = codeCache.getTarget();
RegisterConfig regConfig = codeCache.getRegisterConfig();
byte[] code = installedCode == null ? Arrays.copyOf(compResult.getTargetCode(), compResult.getTargetCodeSize()) : installedCode.getCode();
if (code == null) {
// Method was deoptimized/invalidated
return "";
}
long start = installedCode == null ? 0L : installedCode.getStart();
HexCodeFile hcf = new HexCodeFile(code, start, target.arch.getName(), target.wordSize * 8);
if (compResult != null) {
HexCodeFile.addAnnotations(hcf, compResult.getAnnotations());
addExceptionHandlersComment(compResult, hcf);
Register fp = regConfig.getFrameRegister();
RefMapFormatter slotFormatter = new DefaultRefMapFormatter(target.wordSize, fp, 0);
for (Infopoint infopoint : compResult.getInfopoints()) {
if (infopoint instanceof Call) {
Call call = (Call) infopoint;
if (call.debugInfo != null) {
hcf.addComment(call.pcOffset + call.size, CodeUtil.append(new StringBuilder(100), call.debugInfo, slotFormatter).toString());
}
addOperandComment(hcf, call.pcOffset, "{" + codeCache.getTargetName(call) + "}");
} else {
if (infopoint.debugInfo != null) {
hcf.addComment(infopoint.pcOffset, CodeUtil.append(new StringBuilder(100), infopoint.debugInfo, slotFormatter).toString());
}
addOperandComment(hcf, infopoint.pcOffset, "{infopoint: " + infopoint.reason + "}");
}
}
for (DataPatch site : compResult.getDataPatches()) {
hcf.addOperandComment(site.pcOffset, "{" + site.reference.toString() + "}");
}
for (Mark mark : compResult.getMarks()) {
hcf.addComment(mark.pcOffset, codeCache.getMarkName(mark));
}
}
String hcfEmbeddedString = hcf.toEmbeddedString();
return HexCodeFileDisTool.tryDisassemble(hcfEmbeddedString);
}
示例2: FrameMap
import jdk.vm.ci.code.CodeCacheProvider; //導入方法依賴的package包/類
/**
* Creates a new frame map for the specified method. The given registerConfig is optional, in
* case null is passed the default RegisterConfig from the CodeCacheProvider will be used.
*/
public FrameMap(CodeCacheProvider codeCache, RegisterConfig registerConfig, ReferenceMapBuilderFactory referenceMapFactory) {
this.target = codeCache.getTarget();
this.registerConfig = registerConfig == null ? codeCache.getRegisterConfig() : registerConfig;
this.frameSize = -1;
this.outgoingSize = codeCache.getMinimumOutgoingSize();
this.objectStackSlots = new ArrayList<>();
this.referenceMapFactory = referenceMapFactory;
}