Diff
Modified: trunk/LayoutTests/ChangeLog (94593 => 94594)
--- trunk/LayoutTests/ChangeLog 2011-09-06 20:32:50 UTC (rev 94593)
+++ trunk/LayoutTests/ChangeLog 2011-09-06 20:37:51 UTC (rev 94594)
@@ -1,3 +1,15 @@
+2011-09-06 Filip Pizlo <[email protected]>
+
+ LayoutTests does not include a test for DFG speculation recovery of additions
+ https://bugs.webkit.org/show_bug.cgi?id=67667
+
+ Reviewed by Geoffrey Garen.
+
+ * fast/js/add-recovery-expected.txt: Added.
+ * fast/js/add-recovery.html: Added.
+ * fast/js/script-tests/add-recovery.js: Added.
+ (destructiveAddForBoxedInteger):
+
2011-09-06 David Hyatt <[email protected]>
https://bugs.webkit.org/show_bug.cgi?id=67657
Added: trunk/LayoutTests/fast/js/add-recovery-expected.txt (0 => 94594)
--- trunk/LayoutTests/fast/js/add-recovery-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/js/add-recovery-expected.txt 2011-09-06 20:37:51 UTC (rev 94594)
@@ -0,0 +1,14 @@
+This tests that speculation recovery of destructive additions on unboxed integers works.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS destructiveAddForBoxedInteger({x:1}, 2, 4) is 9
+PASS destructiveAddForBoxedInteger({x:2147483647}, 2, 4) is 2147483655
+PASS destructiveAddForBoxedInteger({x:2}, 2147483647, 4) is 4294967300
+PASS destructiveAddForBoxedInteger({x:2147483647}, 2147483647, 4) is 6442450945
+PASS destructiveAddForBoxedInteger({x:1}, 2, 2147483647) is 2147483652
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/fast/js/add-recovery.html (0 => 94594)
--- trunk/LayoutTests/fast/js/add-recovery.html (rev 0)
+++ trunk/LayoutTests/fast/js/add-recovery.html 2011-09-06 20:37:51 UTC (rev 94594)
@@ -0,0 +1,13 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<link rel="stylesheet" href=""
+<script src=""
+</head>
+<body>
+<p id="description"></p>
+<div id="console"></div>
+<script src=""
+<script src=""
+</body>
+</html>
Added: trunk/LayoutTests/fast/js/script-tests/add-recovery.js (0 => 94594)
--- trunk/LayoutTests/fast/js/script-tests/add-recovery.js (rev 0)
+++ trunk/LayoutTests/fast/js/script-tests/add-recovery.js 2011-09-06 20:37:51 UTC (rev 94594)
@@ -0,0 +1,22 @@
+description(
+"This tests that speculation recovery of destructive additions on unboxed integers works."
+);
+
+function destructiveAddForBoxedInteger(a,b,c) {
+ var a_ = a.x;
+ var d = a_ + b;
+ return c + d + b;
+}
+
+// warm-up foo to be integer
+for (var i = 0; i < 100; ++i) {
+ destructiveAddForBoxedInteger({x:1}, 2, 3);
+}
+
+shouldBe("destructiveAddForBoxedInteger({x:1}, 2, 4)", "9");
+shouldBe("destructiveAddForBoxedInteger({x:2147483647}, 2, 4)", "2147483655");
+shouldBe("destructiveAddForBoxedInteger({x:2}, 2147483647, 4)", "4294967300");
+shouldBe("destructiveAddForBoxedInteger({x:2147483647}, 2147483647, 4)", "6442450945");
+shouldBe("destructiveAddForBoxedInteger({x:1}, 2, 2147483647)", "2147483652");
+
+var successfullyParsed = true;