-
Notifications
You must be signed in to change notification settings - Fork 648
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Imported from static_h Original Author: [email protected] Original Git: b623a8d Original Reviewed By: dannysu Original Revision: D63920292 The interpreter inspects the IP up the stack to determine where to return to, so check whether there's a breakpoint there before doing `nextInstCall`. The check is now faster because we maintain a count of how many installed breakpoints each `CodeBlock` has when the debugger is enabled and check that before doing the more expensive map lookup on every Ret. Reviewed By: avp Differential Revision: D64125238 fbshipit-source-id: 3bf400146c76d6d6cb715b8973ec6dea289f317f
- Loading branch information
1 parent
8ca565c
commit 9df90a5
Showing
6 changed files
with
63 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// RUN: %hdb %s < %s.debug | %FileCheckOrRegen --match-full-lines %s | ||
// REQUIRES: debugger | ||
|
||
function foo() { | ||
debugger; | ||
// Ret has to check the actual opcode at the callsite, | ||
// which means it has to account for breakpoints being installed there. | ||
return 1; | ||
} | ||
|
||
function main(f) { | ||
return f(); | ||
} | ||
|
||
print(main(foo)); | ||
|
||
// Auto-generated content below. Please do not modify manually. | ||
|
||
// CHECK:Break on 'debugger' statement in foo: {{.*}}ret-breakpoint.js[2]:12:3 | ||
// CHECK-NEXT:Set breakpoint 1 at {{.*}}ret-breakpoint.js[2]:19:11 | ||
// CHECK-NEXT:Continuing execution | ||
// CHECK-NEXT:1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
break 19 11 | ||
continue |