forked from mozilla/gecko-dev
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1846534 - Track unwind info for tail calls. r=jseward,mstange,pro…
…filer-reviewers Tail calls are doing some stack data manipulations, and profiler (iterator) needs to know how to find where caller RA and FP stored. A platform now preserves temporary registers used to store FP/RA using collapse frame operations. Differential Revision: https://phabricator.services.mozilla.com/D183269
- Loading branch information
1 parent
0e32e6e
commit 8667790
Showing
27 changed files
with
582 additions
and
39 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
68 changes: 68 additions & 0 deletions
68
js/src/jit-test/tests/wasm/tail-calls/return-call-profiling.js
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,68 @@ | ||
// Tests if the profiler (frame iterator) can unwind in the middle | ||
// of collapse frame instructions. | ||
|
||
enableGeckoProfiling(); | ||
try { | ||
enableSingleStepProfiling(); | ||
} catch (e) { | ||
// continue anyway if single step profiling is not supported | ||
} | ||
|
||
var ins = wasmEvalText(` | ||
(module | ||
(func $f (param i64 i64 i64 i64 i64 i64 i64 i64 i64) | ||
local.get 0 | ||
i64.eqz | ||
br_if 0 | ||
local.get 0 | ||
return_call $g | ||
) | ||
(func $g (param i64) | ||
local.get 0 | ||
i64.const 1 | ||
i64.sub | ||
i64.const 2 | ||
i64.const 6 | ||
i64.const 3 | ||
i64.const 4 | ||
i64.const 1 | ||
i64.const 2 | ||
i64.const 6 | ||
i64.const 3 | ||
return_call $f | ||
) | ||
(func (export "run") (param i64) | ||
local.get 0 | ||
call $g | ||
) | ||
)`); | ||
|
||
for (var i = 0; i < 10; i++) { | ||
ins.exports.run(100n); | ||
} | ||
|
||
// Also when trampoline is used. | ||
var ins0 = wasmEvalText(`(module (func (export "t")))`); | ||
var ins = wasmEvalText(` | ||
(module | ||
(import "" "t" (func $g)) | ||
(func $f (return_call_indirect $t (i32.const 0))) | ||
(table $t 1 1 funcref) | ||
(func (export "run") (param i64) | ||
loop | ||
local.get 0 | ||
i64.eqz | ||
br_if 1 | ||
call $f | ||
local.get 0 | ||
i64.const 1 | ||
i64.sub | ||
local.set 0 | ||
br 0 | ||
end | ||
) | ||
(elem (i32.const 0) $g) | ||
)`, {"": {t: ins0.exports.t},}); | ||
|
||
ins.exports.run(10n); |
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
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
Oops, something went wrong.