summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/saved-stacks/bug1813533.js
blob: e16587413c0f1e85d35992379cf07849de39d37f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();