[vm,dyn_modules] Rename DebugCheck to Nop and use after debugger() calls.

Normally, bytecodes no longer in use would be renamed to Unused<X>.
However, in the case of DebugCheck, its only use was to call the
debugger when single stepping, and since its original creation, the
interpreter has been changed to call the debugger when single stepping
on every instruction. Thus, DebugCheck instructions are effectively
no-ops, only used as a distinct PC offset for source positions, and this
CL changes their name to reflect this.

This CL also changes the bytecode generator to detect uses of debugger()
from dart:developer and to add a Nop after it, mimicking how
StreamingFlowGraphBuilder recognizes uses of debugger() and adds a
DebugStepCheck instruction afterwards. Doing this instead of just
using asm.emitSourcePosition() at the end of visitStaticInvocation
ensures that the source position isn't overwritten by the next emitted
instruction.

TEST=pkg/vm_service/test/set_sdk_library_debuggable_test

Cq-Include-Trybots: luci.dart.try:vm-dyn-linux-debug-x64-try,vm-dyn-mac-debug-arm64-try
Change-Id: Ie24bcea0b5aeb9e41d7765f25b1cd123bb2565b4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/480203
Reviewed-by: Alexander Markov <alexmarkov@google.com>
Commit-Queue: Tess Strickland <sstrickl@google.com>
This commit is contained in:
Tess Strickland
2026-02-19 03:00:23 -08:00
committed by Commit Queue
parent e5800a5aa2
commit fe6ea5e39d
6 changed files with 43 additions and 16 deletions
+3 -4
View File
@@ -1422,8 +1422,7 @@ SP[0] = SP[-1] <op> SP[0] ? true : false
Allocate closure object for closure function ConstantPool[D].
#### DebugCheck
No-op. Provides a point where debugger can stop executing code when single stepping
or when it hits a breakpoint.
#### Nop
No-op. Provides a unique PC offset to ensure an emitted source position is not
overwritten by a different source position emitted by the next instruction.