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