summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/saved-stacks/asm-frames.js
blob: 366712253256654afa509622ea37a4a31b8d8b77 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function AsmModule(stdlib, foreign, heap) {
  "use asm";
  var ffi = foreign.t;

  function doTest() {
    ffi();
  }

  function test() {
    doTest();
  }

  return { test: test };
}

let stack;

function tester() {
  stack = saveStack();
}

const buf = new ArrayBuffer(1024*8);
const module = AsmModule(this, { t: tester }, buf);
module.test();

print(stack);
assertEq(stack.functionDisplayName, "tester");

assertEq(stack.parent.functionDisplayName, "doTest");
assertEq(stack.parent.line, 6);

assertEq(stack.parent.parent.functionDisplayName, "test");
assertEq(stack.parent.parent.line, 10);

assertEq(stack.parent.parent.parent.line, 24);

assertEq(stack.parent.parent.parent.parent, null);