From 1629c3e83f1132afda9af40f469be519d794b673 Mon Sep 17 00:00:00 2001 From: Fabio Niephaus Date: Sun, 20 Oct 2024 13:20:52 +0200 Subject: [PATCH] Fix `CompiledMethod>>callTarget` --- .../hpi/swa/trufflesqueak/model/AbstractSqueakObject.java | 1 - .../de/hpi/swa/trufflesqueak/model/CompiledCodeObject.java | 7 ++++++- src/image | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java index 245309374..d19d47ab5 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/AbstractSqueakObject.java @@ -126,7 +126,6 @@ protected static final Object doSendGeneric(final Node node, final AbstractSquea final NativeObject selector = image.toInteropSelector(message); final Object methodObject = lookupNode.executeLookup(node, classNode.executeLookup(node, receiver), selector); if (methodObject instanceof final CompiledCodeObject method) { - assert message.getLibraryClass() == InteropLibrary.class; final Object[] receiverAndArguments = new Object[message.getParameterCount()]; receiverAndArguments[0] = receiver; for (int i = 0; i < arguments.length; i++) { diff --git a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/CompiledCodeObject.java b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/CompiledCodeObject.java index d035d1fa2..4569e7412 100644 --- a/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/CompiledCodeObject.java +++ b/src/de.hpi.swa.trufflesqueak/src/de/hpi/swa/trufflesqueak/model/CompiledCodeObject.java @@ -199,8 +199,13 @@ public Source getSource() { return executionData.source; } + // used by CompiledMethod>>callTarget public RootCallTarget getCallTargetOrNull() { - return getExecutionData().callTarget; + if (hasExecutionData()) { + return executionData.callTarget; + } else { + return null; + } } public RootCallTarget getCallTarget() { diff --git a/src/image b/src/image index e22cb5439..0a16946f2 160000 --- a/src/image +++ b/src/image @@ -1 +1 @@ -Subproject commit e22cb543967dedddda9d67b93b091e561507d975 +Subproject commit 0a16946f242c908ebba073f29a438d6e6c93e4c8