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

Unified Diff: test/mjsunit/compiler/phi-representations.js

Issue 18838002: Add a test case for Phi representations (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/compiler/phi-representations.js
diff --git a/test/mjsunit/regress/regress-crbug-245424.js b/test/mjsunit/compiler/phi-representations.js
similarity index 77%
copy from test/mjsunit/regress/regress-crbug-245424.js
copy to test/mjsunit/compiler/phi-representations.js
index 005c8baba9492dd339b4fbdc3b48f7577b9c308a..6d11bb0d8ea714daae5e5942b750fa9d3601439b 100644
--- a/test/mjsunit/regress/regress-crbug-245424.js
+++ b/test/mjsunit/compiler/phi-representations.js
@@ -27,15 +27,30 @@
// Flags: --allow-natives-syntax
-function boom() {
- var a = {
- foo: "bar",
- foo: "baz"
+function ar() {
+ var r = undefined;
+ var f = 1;
+ while (f--) {
+ r = (typeof r === 'undefined') ? 0.1 : r;
};
- return a;
+ return (r - r);
}
-assertEquals("baz", boom().foo);
-assertEquals("baz", boom().foo);
-%OptimizeFunctionOnNextCall(boom);
-assertEquals("baz", boom().foo);
+assertEquals(0, ar());
+assertEquals(0, ar());
+%OptimizeFunctionOnNextCall(ar);
+assertEquals(0, ar());
+
+function ar2() {
+ var r = undefined;
+ var f = 1;
+ while (f--) {
+ r = r === undefined ? 0.1 : r;
+ };
+ return (r - r);
+}
+
+assertEquals(0, ar2());
+assertEquals(0, ar2());
+%OptimizeFunctionOnNextCall(ar2);
+assertEquals(0, ar2());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698