]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/make-large-string-jit.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / make-large-string-jit.js
1 // Like make-large-string.js, but tests MakeRope with two arguments in the DFG and FTL JITs.
2
3 var s = "s";
4
5 function foo(a, b) {
6 return a + b;
7 }
8
9 noInline(foo);
10
11 for (var i = 0; i < 100000; ++i)
12 foo("a", "b");
13
14 try {
15 for (var i = 0; i < 31; ++i)
16 s = foo(s, s);
17 print("Should not have gotten here.");
18 print("String length: " + s.length);
19 throw "Should not have gotten here.";
20 } catch (e) {
21 if (e.message != "Out of memory")
22 throw "Wrong error: " + e;
23 }