diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /js/src/jit-test/tests/ion/gc-during-bailout.js | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/ion/gc-during-bailout.js | 158 |
1 files changed, 158 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/ion/gc-during-bailout.js b/js/src/jit-test/tests/ion/gc-during-bailout.js new file mode 100644 index 0000000000..b5cb91882a --- /dev/null +++ b/js/src/jit-test/tests/ion/gc-during-bailout.js @@ -0,0 +1,158 @@ +setJitCompilerOption("ion.warmup.trigger", 30); +gcPreserveCode(); +var o = {}; + +function f(i) { + var obj_1 = { a: 0 }; + var obj_2 = { a: 0 }; + var obj_3 = { a: 0 }; + var obj_4 = { a: 0 }; + var obj_5 = { a: 0 }; + var obj_6 = { a: 0 }; + var obj_7 = { a: 0 }; + var obj_8 = { a: 0 }; + var obj_9 = { a: 0 }; + var obj_10 = { a: 0 }; + var obj_11 = { a: 0 }; + var obj_12 = { a: 0 }; + var obj_13 = { a: 0 }; + var obj_14 = { a: 0 }; + var obj_15 = { a: 0 }; + var obj_16 = { a: 0 }; + var obj_17 = { a: 0 }; + var obj_18 = { a: 0 }; + var obj_19 = { a: 0 }; + var obj_20 = { a: 0 }; + var obj_21 = { a: 0 }; + var obj_22 = { a: 0 }; + var obj_23 = { a: 0 }; + var obj_24 = { a: 0 }; + var obj_25 = { a: 0 }; + var obj_26 = { a: 0 }; + var obj_27 = { a: 0 }; + var obj_28 = { a: 0 }; + var obj_29 = { a: 0 }; + var obj_30 = { a: 0 }; + + // Doing a bailout after the return of the function call implies that we + // cannot resume before the function call. Thus, we would have to recover + // the 30 objects allocations during the bailout. + schedulegc(i % 100); + bailout(); + + obj_1.a = 1; + obj_2.a = 1; + obj_3.a = 1; + obj_4.a = 1; + obj_5.a = 1; + obj_6.a = 1; + obj_7.a = 1; + obj_8.a = 1; + obj_9.a = 1; + obj_10.a = 1; + obj_11.a = 1; + obj_12.a = 1; + obj_13.a = 1; + obj_14.a = 1; + obj_15.a = 1; + obj_16.a = 1; + obj_17.a = 1; + obj_18.a = 1; + obj_19.a = 1; + obj_20.a = 1; + obj_21.a = 1; + obj_22.a = 1; + obj_23.a = 1; + obj_24.a = 1; + obj_25.a = 1; + obj_26.a = 1; + obj_27.a = 1; + obj_28.a = 1; + obj_29.a = 1; + obj_30.a = 1; +} + +for (var i = 0; i < 200; i++) { + // Do not inline 'f', to keep re-entering 'f' at every loop iteration. + with (o) { } + f(i); +} + +// This is the same test except that we do not preserve code under shrinking GC. +gczeal(14); + +function g(i) { + var obj_1 = { a: 0 }; + var obj_2 = { a: 0 }; + var obj_3 = { a: 0 }; + var obj_4 = { a: 0 }; + var obj_5 = { a: 0 }; + var obj_6 = { a: 0 }; + var obj_7 = { a: 0 }; + var obj_8 = { a: 0 }; + var obj_9 = { a: 0 }; + var obj_10 = { a: 0 }; + var obj_11 = { a: 0 }; + var obj_12 = { a: 0 }; + var obj_13 = { a: 0 }; + var obj_14 = { a: 0 }; + var obj_15 = { a: 0 }; + var obj_16 = { a: 0 }; + var obj_17 = { a: 0 }; + var obj_18 = { a: 0 }; + var obj_19 = { a: 0 }; + var obj_20 = { a: 0 }; + var obj_21 = { a: 0 }; + var obj_22 = { a: 0 }; + var obj_23 = { a: 0 }; + var obj_24 = { a: 0 }; + var obj_25 = { a: 0 }; + var obj_26 = { a: 0 }; + var obj_27 = { a: 0 }; + var obj_28 = { a: 0 }; + var obj_29 = { a: 0 }; + var obj_30 = { a: 0 }; + + // Doing a bailout after the return of the function call implies that we + // cannot resume before the function call. Thus, we would have to recover + // the 30 objects allocations during the bailout. + schedulegc(i % 100); + bailout(); + + obj_1.a = 1; + obj_2.a = 1; + obj_3.a = 1; + obj_4.a = 1; + obj_5.a = 1; + obj_6.a = 1; + obj_7.a = 1; + obj_8.a = 1; + obj_9.a = 1; + obj_10.a = 1; + obj_11.a = 1; + obj_12.a = 1; + obj_13.a = 1; + obj_14.a = 1; + obj_15.a = 1; + obj_16.a = 1; + obj_17.a = 1; + obj_18.a = 1; + obj_19.a = 1; + obj_20.a = 1; + obj_21.a = 1; + obj_22.a = 1; + obj_23.a = 1; + obj_24.a = 1; + obj_25.a = 1; + obj_26.a = 1; + obj_27.a = 1; + obj_28.a = 1; + obj_29.a = 1; + obj_30.a = 1; +} + +for (var i = 0; i < 200; i++) { + // Do not inline 'g', to keep re-entering 'g' at every loop iteration. + with (o) { } + g(i); +} |