summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/saved-stacks/bug1813533.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/saved-stacks/bug1813533.js')
-rw-r--r--js/src/jit-test/tests/saved-stacks/bug1813533.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/saved-stacks/bug1813533.js b/js/src/jit-test/tests/saved-stacks/bug1813533.js
new file mode 100644
index 0000000000..e16587413c
--- /dev/null
+++ b/js/src/jit-test/tests/saved-stacks/bug1813533.js
@@ -0,0 +1,22 @@
+async function foo() {
+ // Suspend this function until later.
+ await undefined;
+
+ // Capture the stack using JS::AllFrames.
+ saveStack();
+
+ // Capture the stack using JS::FirstSubsumedFrame.
+ var g = newGlobal({principal: {}});
+ captureFirstSubsumedFrame(g);
+}
+
+// Invoke foo. This will capture the stack and mark the bit
+// on the top-level script, but we clear it below.
+foo();
+
+// Tier up to blinterp, clearing the hasCachedSavedFrame bit
+// on the top-level script.
+for (var i = 0; i < 20; i++) {}
+
+// Continue execution of foo.
+drainJobQueue();