src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File hotspot Cdiff src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java

src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 26,45 **** import jdk.tools.jaotc.binformat.BinaryContainer; import jdk.tools.jaotc.binformat.Relocation; import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage; import jdk.vm.ci.code.BytecodePosition; - import jdk.vm.ci.code.DebugInfo; import jdk.vm.ci.code.VirtualObject; import jdk.vm.ci.code.site.Call; import jdk.vm.ci.code.site.Infopoint; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; - import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.InvokeTarget; ! class InfopointProcessor { private final DataBuilder dataBuilder; private final BinaryContainer binaryContainer; --- 26,43 ---- import jdk.tools.jaotc.binformat.BinaryContainer; import jdk.tools.jaotc.binformat.Relocation; import org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage; import jdk.vm.ci.code.BytecodePosition; import jdk.vm.ci.code.VirtualObject; import jdk.vm.ci.code.site.Call; import jdk.vm.ci.code.site.Infopoint; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.InvokeTarget; ! final class InfopointProcessor { private final DataBuilder dataBuilder; private final BinaryContainer binaryContainer;
*** 68,97 **** 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()); } private void recordScopeKlasses(CompiledMethodInfo methodInfo, BytecodePosition bcp, VirtualObject[] vos) { BytecodePosition caller = bcp.getCaller(); if (caller != null) { recordScopeKlasses(methodInfo, caller, vos); } ! HotSpotResolvedJavaMethod m = (HotSpotResolvedJavaMethod)bcp.getMethod(); HotSpotResolvedObjectType klass = m.getDeclaringClass(); methodInfo.addDependentKlassData(binaryContainer, klass); ! if (vos == null) return; ! for (VirtualObject vo : vos) { ! HotSpotResolvedObjectType vk = (HotSpotResolvedObjectType)vo.getType(); methodInfo.addDependentKlassData(binaryContainer, vk); } } --- 66,100 ---- 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()); } private void recordScopeKlasses(CompiledMethodInfo methodInfo, BytecodePosition bcp, VirtualObject[] vos) { BytecodePosition caller = bcp.getCaller(); if (caller != null) { recordScopeKlasses(methodInfo, caller, vos); } ! HotSpotResolvedJavaMethod m = (HotSpotResolvedJavaMethod) bcp.getMethod(); HotSpotResolvedObjectType klass = m.getDeclaringClass(); methodInfo.addDependentKlassData(binaryContainer, klass); ! if (vos == null) { ! return; ! } for (VirtualObject vo : vos) { ! HotSpotResolvedObjectType vk = (HotSpotResolvedObjectType) vo.getType(); methodInfo.addDependentKlassData(binaryContainer, vk); } }
*** 114,129 **** } /** * Get information about the call site. Name of the callee and relocation call type. */ ! private CallSiteRelocationInfo getCallSiteRelocationInfo(Call call) { InvokeTarget callTarget = call.target; if (callTarget instanceof HotSpotResolvedJavaMethod) { return new JavaCallSiteRelocationInfo(call, (HotSpotResolvedJavaMethod) callTarget); } else if (callTarget instanceof HotSpotForeignCallLinkage) { ! return new ForeignCallSiteRelocationInfo(call, (HotSpotForeignCallLinkage) callTarget, dataBuilder); } else { throw new InternalError("Unhandled call type found in infopoint: " + callTarget); } } --- 117,132 ---- } /** * Get information about the call site. Name of the callee and relocation call type. */ ! private static CallSiteRelocationInfo getCallSiteRelocationInfo(Call call) { InvokeTarget callTarget = call.target; if (callTarget instanceof HotSpotResolvedJavaMethod) { return new JavaCallSiteRelocationInfo(call, (HotSpotResolvedJavaMethod) callTarget); } else if (callTarget instanceof HotSpotForeignCallLinkage) { ! return new ForeignCallSiteRelocationInfo(call, (HotSpotForeignCallLinkage) callTarget); } else { throw new InternalError("Unhandled call type found in infopoint: " + callTarget); } }
*** 134,147 **** switch (callSiteRelocation.type) { case STUB_CALL_DIRECT: return new StubDirectCallSiteRelocationSymbol(callSiteRelocation, binaryContainer); case FOREIGN_CALL_INDIRECT_GOT: return new ForeignGotCallSiteRelocationSymbol(mi, call, callSiteRelocation, dataBuilder); - case FOREIGN_CALL_DIRECT: - case FOREIGN_CALL_DIRECT_FAR: - case FOREIGN_CALL_INDIRECT: - return new ForeignCallSiteRelocationSymbol(callSiteRelocation, binaryContainer); default: return new JavaCallSiteRelocationSymbol(mi, call, callSiteRelocation, binaryContainer); } } --- 137,146 ----
src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/InfopointProcessor.java
Index Unified diffs Context diffs Sdiffs Frames Patch New Old Previous File Next File