Skip to content

Commit

Permalink
[vm] Verify that frame size doesn't change between awaits (in AOT mode)
Browse files Browse the repository at this point in the history
TEST=ci

Issue: #48378
Change-Id: I05e1a55070d77fea4402a9db56fca5b3be7207b5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243042
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Alexander Markov <alexmarkov@google.com>
  • Loading branch information
alexmarkov authored and Commit Bot committed May 2, 2022
1 parent 81f6cc1 commit 0a2d611
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions runtime/vm/compiler/stub_code_compiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1394,6 +1394,20 @@ void StubCodeCompiler::GenerateSuspendStub(
__ Bind(&init_done);
__ Comment("Copy frame to SuspendState");

#ifdef DEBUG
{
// Verify that SuspendState.frame_size == kFrameSize.
Label okay;
__ LoadFromOffset(
kTemp,
FieldAddress(kSuspendState, target::SuspendState::frame_size_offset()));
__ CompareRegisters(kTemp, kFrameSize);
__ BranchIf(EQUAL, &okay);
__ Breakpoint();
__ Bind(&okay);
}
#endif

__ LoadFromOffset(
kTemp, Address(FPREG, kSavedCallerPcSlotFromFp * target::kWordSize));
__ StoreToOffset(
Expand All @@ -1412,6 +1426,8 @@ void StubCodeCompiler::GenerateSuspendStub(

#ifdef DEBUG
{
// Verify that kSuspendState matches :suspend_state in the copied stack
// frame.
Label okay;
__ LoadFromOffset(
kTemp,
Expand Down

0 comments on commit 0a2d611

Please sign in to comment.