本文整理汇总了Java中jdk.vm.ci.code.site.Infopoint类的典型用法代码示例。如果您正苦于以下问题:Java Infopoint类的具体用法?Java Infopoint怎么用?Java Infopoint使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Infopoint类属于jdk.vm.ci.code.site包,在下文中一共展示了Infopoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
/**
* Parse an {@link Infopoint} generated by the compiler and create all needed binary section
* constructs.
*
* @param methodInfo compiled method info
* @param info info point being processed
*/
void process(CompiledMethodInfo methodInfo, Infopoint info) {
switch (info.reason) {
case CALL:
// All calls in compiled code need a symbol and relocation entry.
processCallInfoPoint(methodInfo, (Call) info);
break;
case SAFEPOINT:
case IMPLICIT_EXCEPTION:
case METHOD_START:
case METHOD_END:
case BYTECODE_POSITION:
break;
default:
throw new InternalError("Unknown info point reason: " + info.reason);
}
if (info.debugInfo == null) {
return;
}
BytecodePosition bcp = info.debugInfo.getBytecodePosition();
if (bcp == null) {
return;
}
recordScopeKlasses(methodInfo, bcp, info.debugInfo.getVirtualObjectMapping());
}
示例2: lineInfopoints
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Test
public void lineInfopoints() {
final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
final StructuredGraph graph = parse(builder(method, AllowAssumptions.ifTrue(OptAssumptions.getValue(getInitialOptions()))), getDebugGraphBuilderSuite());
int graphLineSPs = 0;
for (FullInfopointNode ipn : graph.getNodes().filter(FullInfopointNode.class)) {
if (ipn.getReason() == InfopointReason.BYTECODE_POSITION) {
++graphLineSPs;
}
}
assertTrue(graphLineSPs > 0);
PhaseSuite<HighTierContext> graphBuilderSuite = getCustomGraphBuilderSuite(GraphBuilderConfiguration.getDefault(getDefaultGraphBuilderPlugins()).withFullInfopoints(true));
final CompilationResult cr = compileGraph(graph, graph.method(), getProviders(), getBackend(), graphBuilderSuite, OptimisticOptimizations.ALL, graph.getProfilingInfo(),
createSuites(graph.getOptions()), createLIRSuites(graph.getOptions()), new CompilationResult(graph.compilationId()), CompilationResultBuilderFactory.Default);
int lineSPs = 0;
for (Infopoint sp : cr.getInfopoints()) {
assertNotNull(sp.reason);
if (sp.reason == InfopointReason.BYTECODE_POSITION) {
++lineSPs;
}
}
assertTrue(lineSPs > 0);
}
示例3: lineInfopoints
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Test
public void lineInfopoints() {
final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
final StructuredGraph graph = parseDebug(method, AllowAssumptions.ifTrue(OptAssumptions.getValue(getInitialOptions())));
int graphLineSPs = 0;
for (FullInfopointNode ipn : graph.getNodes().filter(FullInfopointNode.class)) {
if (ipn.getReason() == InfopointReason.BYTECODE_POSITION) {
++graphLineSPs;
}
}
assertTrue(graphLineSPs > 0);
PhaseSuite<HighTierContext> graphBuilderSuite = getCustomGraphBuilderSuite(GraphBuilderConfiguration.getDefault(getDefaultGraphBuilderPlugins()).withFullInfopoints(true));
final CompilationResult cr = compileGraph(graph, graph.method(), getProviders(), getBackend(), graphBuilderSuite, OptimisticOptimizations.ALL, graph.getProfilingInfo(),
createSuites(graph.getOptions()), createLIRSuites(graph.getOptions()), new CompilationResult(), CompilationResultBuilderFactory.Default);
int lineSPs = 0;
for (Infopoint sp : cr.getInfopoints()) {
assertNotNull(sp.reason);
if (sp.reason == InfopointReason.BYTECODE_POSITION) {
++lineSPs;
}
}
assertTrue(lineSPs > 0);
}
示例4: disassemble
import jdk.vm.ci.code.site.Infopoint; //导入依赖的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);
}
示例5: getInfopoints
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
/**
* @return the list of infopoints, sorted by {@link Site#pcOffset}
*/
public List<Infopoint> getInfopoints() {
if (infopoints.isEmpty()) {
return emptyList();
}
return unmodifiableList(infopoints);
}
示例6: callInfopoints
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Test
public void callInfopoints() {
final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
final StructuredGraph graph = parseEager(method, AllowAssumptions.YES);
final CompilationResult cr = compileGraph(graph, graph.method(), getProviders(), getBackend(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, graph.getProfilingInfo(),
createSuites(graph.getOptions()), createLIRSuites(graph.getOptions()), new CompilationResult(graph.compilationId()), CompilationResultBuilderFactory.Default);
for (Infopoint sp : cr.getInfopoints()) {
assertNotNull(sp.reason);
if (sp instanceof Call) {
assertDeepEquals(InfopointReason.CALL, sp.reason);
}
}
}
示例7: checkCollision
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
static int checkCollision(Infopoint i1, Infopoint i2) {
int o1 = ord(i1);
int o2 = ord(i2);
if (o1 < 0 && o2 < 0) {
throw new GraalError("Non optional infopoints cannot collide: %s and %s", i1, i2);
}
return o1 - o2;
}
示例8: compare
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Override
public int compare(Site s1, Site s2) {
if (s1.pcOffset == s2.pcOffset) {
// Marks must come first since patching a call site
// may need to know the mark denoting the call type
// (see uses of CodeInstaller::_next_call_type).
boolean s1IsMark = s1 instanceof Mark;
boolean s2IsMark = s2 instanceof Mark;
if (s1IsMark != s2IsMark) {
return s1IsMark ? -1 : 1;
}
// Infopoints must group together so put them after
// other Site types.
boolean s1IsInfopoint = s1 instanceof Infopoint;
boolean s2IsInfopoint = s2 instanceof Infopoint;
if (s1IsInfopoint != s2IsInfopoint) {
return s1IsInfopoint ? 1 : -1;
}
if (s1IsInfopoint) {
sawCollidingInfopoints = true;
return checkCollision((Infopoint) s1, (Infopoint) s2);
}
}
return s1.pcOffset - s2.pcOffset;
}
示例9: callInfopoints
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Test
public void callInfopoints() {
final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod");
final StructuredGraph graph = parseEager(method, AllowAssumptions.YES);
final CompilationResult cr = compileGraph(graph, graph.method(), getProviders(), getBackend(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, graph.getProfilingInfo(),
createSuites(graph.getOptions()), createLIRSuites(graph.getOptions()), new CompilationResult(), CompilationResultBuilderFactory.Default);
for (Infopoint sp : cr.getInfopoints()) {
assertNotNull(sp.reason);
if (sp instanceof Call) {
assertDeepEquals(InfopointReason.CALL, sp.reason);
}
}
}
示例10: ord
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
static int ord(Infopoint info) {
return HOTSPOT_INFOPOINT_SORT_ORDER.get(info.reason);
}
示例11: testInfopointMissingDebugInfo
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Test(expected = JVMCIError.class)
public void testInfopointMissingDebugInfo() {
Infopoint info = new Infopoint(0, null, InfopointReason.METHOD_START);
installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0], null);
}
示例12: testSafepointMissingDebugInfo
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
@Test(expected = JVMCIError.class)
public void testSafepointMissingDebugInfo() {
Infopoint info = new Infopoint(0, null, InfopointReason.SAFEPOINT);
StackSlot deoptRescueSlot = StackSlot.get(null, 0, true);
installEmptyCode(new Site[]{info}, new Assumption[0], new Comment[0], 16, new DataPatch[0], deoptRescueSlot);
}
示例13: test
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
private void test(VirtualObject[] vobj, JavaValue[] values, JavaKind[] slotKinds, int locals, int stack, int locks, StackSlot deoptRescueSlot) {
BytecodeFrame frame = new BytecodeFrame(null, dummyMethod, 0, false, false, values, slotKinds, locals, stack, locks);
DebugInfo info = new DebugInfo(frame, vobj);
info.setReferenceMap(new HotSpotReferenceMap(new Location[0], new Location[0], new int[0], 8));
installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], deoptRescueSlot);
}
示例14: test
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
private void test(ReferenceMap refMap) {
BytecodePosition pos = new BytecodePosition(null, dummyMethod, 0);
DebugInfo info = new DebugInfo(pos);
info.setReferenceMap(refMap);
installEmptyCode(new Site[]{new Infopoint(0, info, InfopointReason.SAFEPOINT)}, new Assumption[0], new Comment[0], 16, new DataPatch[0], StackSlot.get(null, 0, true));
}
示例15: recordImplicitException
import jdk.vm.ci.code.site.Infopoint; //导入依赖的package包/类
protected void recordImplicitException(DebugInfo info) {
sites.add(new Infopoint(code.position(), info, InfopointReason.IMPLICIT_EXCEPTION));
}