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

Unified Diff: test/mjsunit/regress/regress-crbug-336148.js

Issue 185653004: Experimental parser: merge to r19637 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 10 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 | « test/mjsunit/regress/regress-crbug-248025.js ('k') | test/mjsunit/regress/regress-crbug-340064.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/regress/regress-crbug-336148.js
diff --git a/test/mjsunit/regress/regress-331416.js b/test/mjsunit/regress/regress-crbug-336148.js
similarity index 76%
copy from test/mjsunit/regress/regress-331416.js
copy to test/mjsunit/regress/regress-crbug-336148.js
index 0c60fced14e1c185919985fd011c9ca46d93ff3f..8157c9fcc1978c632a32f1930af56cf113276bcc 100644
--- a/test/mjsunit/regress/regress-331416.js
+++ b/test/mjsunit/regress/regress-crbug-336148.js
@@ -27,26 +27,30 @@
// Flags: --allow-natives-syntax
-function load(a, i) {
- return a[i];
+function f(o) {
+ var a = 1;
+ if (true) return o.v && a;
}
-load([1, 2, 3], "length");
-load(3);
-load([1, 2, 3], 3);
-load(0, 0);
-%OptimizeFunctionOnNextCall(load);
-assertEquals(2, load([1, 2, 3], 1));
-assertEquals(undefined, load(0, 0));
-function store(a, i, x) {
- a[i] = x;
+f({});
+f({});
+%OptimizeFunctionOnNextCall(f);
+assertEquals(1, f({ v: 1 }));
+
+
+function f1() { return 1 && 2; };
+function f2() { return 1 || 2; };
+function f3() { return 0 && 2; };
+function f4() { return 0 || 2; };
+
+function test() {
+ assertEquals(2, f1());
+ assertEquals(1, f2());
+ assertEquals(0, f3());
+ assertEquals(2, f4());
}
-store([1, 2, 3], "length", 3);
-store(3);
-store([1, 2, 3], 3, 3);
-store(0, 0, 1);
-%OptimizeFunctionOnNextCall(store);
-var a = [1, 2, 3];
-store(a, 1, 1);
-assertEquals(1, a[1]);
-store(0, 0, 1);
+
+test();
+test();
+[f1, f2, f3, f4].forEach(function(f) { %OptimizeFunctionOnNextCall(f); });
+test();
« no previous file with comments | « test/mjsunit/regress/regress-crbug-248025.js ('k') | test/mjsunit/regress/regress-crbug-340064.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698