diff --git a/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java b/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java index f4aecf0e0116..c5f8545c1618 100644 --- a/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java +++ b/truffle/src/com.oracle.truffle.tck.instrumentation/src/com/oracle/truffle/tck/instrumentation/VerifierInstrument.java @@ -50,6 +50,7 @@ import com.oracle.truffle.api.CompilerDirectives; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary; +import com.oracle.truffle.api.frame.FrameSlotKind; import com.oracle.truffle.api.frame.MaterializedFrame; import com.oracle.truffle.api.frame.VirtualFrame; import com.oracle.truffle.api.impl.Accessor; @@ -256,6 +257,12 @@ public void onReturnExceptional(EventContext context, VirtualFrame frame, Throwa private static final class RootFrameChecker implements ExecutionEventListener { + @Override + public void onResume(EventContext context, VirtualFrame frame) { + // Overridden to prevent the default delegation to onEnter. For a coroutine resume, the + // frame doesn't have to be empty + } + @Override public void onEnter(EventContext context, VirtualFrame frame) { checkFrameIsEmpty(context, frame.materialize()); @@ -271,7 +278,7 @@ private static void checkFrameIsEmpty(EventContext context, MaterializedFrame fr if (frame.isStatic(slot)) { Assert.assertEquals("Top-most nodes tagged with RootTag should have clean frames.", defaultValue, frame.getObjectStatic(slot)); Assert.assertEquals("Top-most nodes tagged with RootTag should have clean frames.", 0L, frame.getLongStatic(slot)); - } else { + } else if (frame.getTag(slot) != FrameSlotKind.Illegal.tag) { Assert.assertEquals("Top-most nodes tagged with RootTag should have clean frames.", defaultValue, frame.getValue(slot)); } }