Skip to content

Commit 0a2d611

Browse files
alexmarkovCommit Bot
authored and
Commit Bot
committed
[vm] Verify that frame size doesn't change between awaits (in AOT mode)
TEST=ci Issue: #48378 Change-Id: I05e1a55070d77fea4402a9db56fca5b3be7207b5 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/243042 Reviewed-by: Martin Kustermann <[email protected]> Commit-Queue: Alexander Markov <[email protected]>
1 parent 81f6cc1 commit 0a2d611

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

runtime/vm/compiler/stub_code_compiler.cc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,20 @@ void StubCodeCompiler::GenerateSuspendStub(
13941394
__ Bind(&init_done);
13951395
__ Comment("Copy frame to SuspendState");
13961396

1397+
#ifdef DEBUG
1398+
{
1399+
// Verify that SuspendState.frame_size == kFrameSize.
1400+
Label okay;
1401+
__ LoadFromOffset(
1402+
kTemp,
1403+
FieldAddress(kSuspendState, target::SuspendState::frame_size_offset()));
1404+
__ CompareRegisters(kTemp, kFrameSize);
1405+
__ BranchIf(EQUAL, &okay);
1406+
__ Breakpoint();
1407+
__ Bind(&okay);
1408+
}
1409+
#endif
1410+
13971411
__ LoadFromOffset(
13981412
kTemp, Address(FPREG, kSavedCallerPcSlotFromFp * target::kWordSize));
13991413
__ StoreToOffset(
@@ -1412,6 +1426,8 @@ void StubCodeCompiler::GenerateSuspendStub(
14121426

14131427
#ifdef DEBUG
14141428
{
1429+
// Verify that kSuspendState matches :suspend_state in the copied stack
1430+
// frame.
14151431
Label okay;
14161432
__ LoadFromOffset(
14171433
kTemp,

0 commit comments

Comments
 (0)