]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - tests/stress/make-large-string-jit-strcat.js
JavaScriptCore-1218.35.tar.gz
[apple/javascriptcore.git] / tests / stress / make-large-string-jit-strcat.js
diff --git a/tests/stress/make-large-string-jit-strcat.js b/tests/stress/make-large-string-jit-strcat.js
new file mode 100644 (file)
index 0000000..a6aeb1d
--- /dev/null
@@ -0,0 +1,24 @@
+// Like make-large-string-jit.js, but tests MakeRope with three arguments and op_strcat
+// in the DFG and FTL JITs.
+
+var s = "s";
+
+function foo(a, b) {
+    return "t" + a + b;
+}
+
+noInline(foo);
+
+for (var i = 0; i < 100000; ++i)
+    foo("a", "b");
+
+try {
+    for (var i = 0; i < 31; ++i)
+        s = foo(s, s);
+    print("Should not have gotten here.");
+    print("String length: " + s.length);
+    throw "Should not have gotten here.";
+} catch (e) {
+    if (e.message != "Out of memory")
+        throw "Wrong error: " + e;
+}