Skip to content

Commit 032309d

Browse files
lewurmzapster
authored andcommitted
Interpreter: NativeImage::localSymbolNameForMethod behaves differently for Analysis- vs. HostedMethod. Only accept the latter
1 parent 7af630b commit 032309d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/AArch64InterpreterStubSection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
import com.oracle.svm.core.graal.meta.SubstrateRegisterConfig;
4444
import com.oracle.svm.core.util.VMError;
4545
import com.oracle.svm.hosted.image.NativeImage;
46+
import com.oracle.svm.hosted.meta.HostedMethod;
4647
import com.oracle.svm.interpreter.metadata.InterpreterResolvedJavaMethod;
4748

4849
import jdk.graal.compiler.asm.Assembler;
4950
import jdk.graal.compiler.asm.Label;
5051
import jdk.graal.compiler.asm.aarch64.AArch64MacroAssembler;
5152
import jdk.graal.compiler.core.common.LIRKind;
5253
import jdk.vm.ci.code.Register;
53-
import jdk.vm.ci.meta.ResolvedJavaMethod;
5454

5555
public class AArch64InterpreterStubSection extends InterpreterStubSection {
5656
public AArch64InterpreterStubSection() {
@@ -159,7 +159,7 @@ private void recordEnterStubForPatching(Assembler.CodeAnnotation a) {
159159

160160
@Platforms(Platform.HOSTED_ONLY.class)
161161
@Override
162-
protected void markEnterStubPatch(ObjectFile.ProgbitsSectionImpl pltBuffer, ResolvedJavaMethod enterStub) {
162+
protected void markEnterStubPatch(ObjectFile.ProgbitsSectionImpl pltBuffer, HostedMethod enterStub) {
163163
pltBuffer.markRelocationSite(resolverPatchOffset, AARCH64_R_AARCH64_ADR_PREL_PG_HI21, NativeImage.localSymbolNameForMethod(enterStub), 0);
164164
pltBuffer.markRelocationSite(resolverPatchOffset + 4, AARCH64_R_AARCH64_ADD_ABS_LO12_NC, NativeImage.localSymbolNameForMethod(enterStub), 0);
165165
}

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/AMD64InterpreterStubSection.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import com.oracle.svm.core.graal.meta.SubstrateRegisterConfig;
4141
import com.oracle.svm.core.util.VMError;
4242
import com.oracle.svm.hosted.image.NativeImage;
43+
import com.oracle.svm.hosted.meta.HostedMethod;
4344
import com.oracle.svm.interpreter.metadata.InterpreterResolvedJavaMethod;
4445

4546
import jdk.graal.compiler.asm.Assembler;
@@ -48,7 +49,6 @@
4849
import jdk.graal.compiler.asm.amd64.AMD64MacroAssembler;
4950
import jdk.graal.compiler.core.common.LIRKind;
5051
import jdk.graal.compiler.core.common.NumUtil;
51-
import jdk.vm.ci.meta.ResolvedJavaMethod;
5252

5353
public class AMD64InterpreterStubSection extends InterpreterStubSection {
5454
public AMD64InterpreterStubSection() {
@@ -144,7 +144,7 @@ private void recordEnterStubForPatching(Assembler.CodeAnnotation a) {
144144

145145
@Platforms(Platform.HOSTED_ONLY.class)
146146
@Override
147-
protected void markEnterStubPatch(ObjectFile.ProgbitsSectionImpl pltBuffer, ResolvedJavaMethod enterStub) {
147+
protected void markEnterStubPatch(ObjectFile.ProgbitsSectionImpl pltBuffer, HostedMethod enterStub) {
148148
pltBuffer.markRelocationSite(resolverPatchOffset, resolverPatchRelocationKind, NativeImage.localSymbolNameForMethod(enterStub), resolverKindAddend);
149149
}
150150
}

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/DebuggerFeature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ public void beforeImageWrite(BeforeImageWriteAccess access) {
761761

762762
InterpreterStubSection stubSection = ImageSingletons.lookup(InterpreterStubSection.class);
763763

764-
stubSection.markEnterStubPatch(enterInterpreterMethod);
764+
stubSection.markEnterStubPatch(accessImpl.getHostedUniverse().lookup(enterInterpreterMethod));
765765
enterStubTable.writeMetadataHashString(hashString.getBytes(StandardCharsets.UTF_8));
766766
}
767767

substratevm/src/com.oracle.svm.interpreter/src/com/oracle/svm/interpreter/InterpreterStubSection.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@
6464
import com.oracle.svm.hosted.image.AbstractImage;
6565
import com.oracle.svm.hosted.image.NativeImage;
6666
import com.oracle.svm.hosted.image.RelocatableBuffer;
67+
import com.oracle.svm.hosted.meta.HostedMethod;
6768
import com.oracle.svm.interpreter.metadata.InterpreterResolvedJavaMethod;
6869
import com.oracle.svm.interpreter.metadata.InterpreterResolvedObjectType;
6970
import com.oracle.svm.interpreter.metadata.InterpreterUnresolvedSignature;
@@ -77,7 +78,6 @@
7778
import jdk.vm.ci.meta.AllocatableValue;
7879
import jdk.vm.ci.meta.JavaKind;
7980
import jdk.vm.ci.meta.JavaType;
80-
import jdk.vm.ci.meta.ResolvedJavaMethod;
8181
import jdk.vm.ci.meta.ResolvedJavaType;
8282

8383
@InternalVMMethod
@@ -177,12 +177,12 @@ protected void recordEnterTrampoline(InterpreterResolvedJavaMethod m, int positi
177177
public abstract int getVTableStubSize();
178178

179179
@Platforms(Platform.HOSTED_ONLY.class)
180-
public void markEnterStubPatch(ResolvedJavaMethod enterStub) {
180+
public void markEnterStubPatch(HostedMethod enterStub) {
181181
markEnterStubPatch(stubsBufferImpl, enterStub);
182182
}
183183

184184
@Platforms(Platform.HOSTED_ONLY.class)
185-
protected abstract void markEnterStubPatch(ObjectFile.ProgbitsSectionImpl pltBuffer, ResolvedJavaMethod enterStub);
185+
protected abstract void markEnterStubPatch(ObjectFile.ProgbitsSectionImpl pltBuffer, HostedMethod enterStub);
186186

187187
@Deoptimizer.DeoptStub(stubType = Deoptimizer.StubType.InterpreterEnterStub)
188188
@NeverInline("needs ABI boundary")

0 commit comments

Comments
 (0)