3131import static org .graalvm .compiler .nodes .Invoke .CYCLES_UNKNOWN_RATIONALE ;
3232import static org .graalvm .compiler .nodes .Invoke .SIZE_UNKNOWN_RATIONALE ;
3333
34- import org .graalvm .compiler .core .common .type .StampFactory ;
35- import org .graalvm .compiler .core .common .type .TypeReference ;
34+ import org .graalvm .compiler .core .common .type .Stamp ;
3635import org .graalvm .compiler .graph .NodeClass ;
3736import org .graalvm .compiler .nodeinfo .NodeInfo ;
3837import org .graalvm .compiler .nodes .WithExceptionNode ;
3938import org .graalvm .compiler .nodes .memory .SingleMemoryKill ;
4039import org .graalvm .word .LocationIdentity ;
4140
42- import jdk .vm .ci .meta .MetaAccessProvider ;
43-
4441/**
4542 * Placeholder for a fallback call from a {@link MacroStateSplitWithExceptionNode}.
4643 *
47- * The {@link #fallbackFunctionCallThrowing ()} intrinsic can be used in snippets that lower a
44+ * The {@link #fallbackFunctionCall ()} intrinsic can be used in snippets that lower a
4845 * {@link MacroStateSplitWithExceptionNode}. The {@link FallbackInvokeWithExceptionNode} will be
4946 * replaced with the {@linkplain MacroStateSplitWithExceptionNode#createInvoke original call} of the
5047 * macro node. This can be useful for handling exceptional and/or slow path cases.
@@ -60,18 +57,27 @@ public final class FallbackInvokeWithExceptionNode extends WithExceptionNode imp
6057
6158 public static final NodeClass <FallbackInvokeWithExceptionNode > TYPE = NodeClass .create (FallbackInvokeWithExceptionNode .class );
6259
63- public FallbackInvokeWithExceptionNode (@ InjectedNodeParameter MetaAccessProvider metaAccess ) {
64- super (TYPE , StampFactory . objectNonNull ( TypeReference . createExactTrusted ( metaAccess . lookupJavaType ( Object . class ))) );
60+ public FallbackInvokeWithExceptionNode (@ InjectedNodeParameter Stamp stamp ) {
61+ super (TYPE , stamp );
6562 }
6663
6764 @ Override
6865 public LocationIdentity getKilledLocationIdentity () {
6966 return LocationIdentity .any ();
7067 }
7168
69+ /**
70+ * At the time when this node was created (i.e. when creating the snippet template), we did not
71+ * have actual parameters so the precise stamp was not known. To fix that, we allow updating it
72+ * after the snippet was instantiated.
73+ */
74+ public boolean updateInitialStamp (Stamp newStamp ) {
75+ return updateStamp (newStamp );
76+ }
77+
7278 /**
7379 * @see FallbackInvokeWithExceptionNode
7480 */
7581 @ NodeIntrinsic
76- public static native void fallbackFunctionCallThrowing ();
82+ public static native Object fallbackFunctionCall ();
7783}
0 commit comments