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 1754443 - Do not schedule DelazifyTask if there is no inner funct…
…ion to delazify. r=arai Differential Revision: https://phabricator.services.mozilla.com/D138292
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
js/src/jit-test/tests/parser/stencil-eager-delazify-empty.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,22 @@ | ||
// |jit-test| skip-if: helperThreadCount() === 0 || isLcovEnabled() | ||
|
||
// Extra GCs can empty the StencilCache to reclaim memory. This lines | ||
// re-configure the gc-zeal setting to prevent this from happening in this test | ||
// case which waits for the cache to contain some entry. | ||
if ('gczeal' in this) | ||
gczeal(0); | ||
|
||
// Generate a source code with no inner functions. | ||
function justVariables(n) { | ||
let text = ""; | ||
for (let i = 0; i < n; i++) { | ||
text += `let v${i} = ${i};`; | ||
} | ||
return text; | ||
}; | ||
|
||
// Create an extra task to test the case where there is nothing to delazify. | ||
let job = offThreadCompileToStencil(justVariables(10000), options); | ||
|
||
const stencil = finishOffThreadCompileToStencil(job); | ||
evalStencil(stencil, options); |
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