summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/baseline/osr-large-stack-frame.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/jit-test/tests/baseline/osr-large-stack-frame.js')
-rw-r--r--js/src/jit-test/tests/baseline/osr-large-stack-frame.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/baseline/osr-large-stack-frame.js b/js/src/jit-test/tests/baseline/osr-large-stack-frame.js
new file mode 100644
index 0000000000..bcaca2cfc2
--- /dev/null
+++ b/js/src/jit-test/tests/baseline/osr-large-stack-frame.js
@@ -0,0 +1,18 @@
+// Creates a huge stack frame and uses OSR. See bug 1839669.
+function f() {
+ var varinits = [];
+ var varnames = [];
+ for (var i = 0; i < 19553; i++) {
+ var varname = `x${i}`;
+ varnames.push(varname);
+ varinits.push(`${varname} = ${i}`);
+ }
+ var source = "var " + varinits.join(",") + ";\n";
+ source += "for (var i = 0; i < 100; i++) {}\n";
+ source += "return " + varnames.join("+") + ";";
+
+ var g = new Function(source);
+ assertEq(g(), 191150128);
+ assertEq(g(), 191150128);
+}
+f();