Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand All @@ -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));
}
}
Expand Down