Reviewers: Toon Verwaest,
Message:
PTAL.
The first test (function "ar") is broken in 3.18 and earlier branches, the
second test (function "ar2") was broken until 3.14. Adding this test to make
sure we won't regress in the future.
Description:
Add a test case for Phi representations
BUG=chromium:167394
Please review this at https://codereview.chromium.org/18838002/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
A + test/mjsunit/compiler/phi-representations.js
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());
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.