Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Unified Diff: test/webkit/dfg-int32-to-double-on-set-local-and-exit.js

Issue 18068003: Migrated several tests from blink to V8 repository. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
diff --git a/test/webkit/concat-while-having-a-bad-time.js b/test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
similarity index 64%
copy from test/webkit/concat-while-having-a-bad-time.js
copy to test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
index dfda1e08a0b36194b787a44ee12a9693acd8aeaf..8686391163732102020e7b8a38b5712111e9b704 100644
--- a/test/webkit/concat-while-having-a-bad-time.js
+++ b/test/webkit/dfg-int32-to-double-on-set-local-and-exit.js
@@ -22,10 +22,42 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
description(
-"Tests the behavior of Array.prototype.concat while the array is having a bad time due to one of the elements we are concatenating."
+"Tests that an Int32ToDouble placed on a SetLocal does a forward exit."
);
-Object.defineProperty(Array.prototype, 0, { writable: false });
-shouldBe("[42].concat()", "[42]");
+var counter = 0;
+function checkpoint(text) {
+ debug("Checkpoint: " + text);
+ counter++;
+}
+function func1() {
+ checkpoint("a");
+ a = Date.now() + Date.now() + Date.now() + Date.now() + Date.now() + Date.now();
+ checkpoint("b");
+}
+function func2() {
+ checkpoint("c");
+ return Date.now() + Date.now() + Date.now() + Date.now() + Date.now() + Date.now();
+}
+
+function func3(s) {
+ checkpoint("1");
+ s = func1(); // The bug is that this function will be called twice, if our Int32ToDouble hoisting does a backward speculation.
+ checkpoint("2");
+ s = func2();
+ checkpoint("3");
+ return s;
+}
+
+function test() {
+ return func3(1);
+}
+
+
+for (var i=0; i < 200; i++) {
+ test();
+}
+
+shouldBe("counter", "1200");

Powered by Google App Engine
This is Rietveld 408576698