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

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

Issue 160543002: Merged r19031 into 3.22 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.22
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 | « src/version.cc ('k') | no next file » | 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-334708.js b/test/mjsunit/regress/regress-crbug-336148.js
similarity index 77%
copy from test/mjsunit/regress/regress-334708.js
copy to test/mjsunit/regress/regress-crbug-336148.js
index f0291bbdab61128baad9df89457d045b66644f1b..8157c9fcc1978c632a32f1930af56cf113276bcc 100644
--- a/test/mjsunit/regress/regress-334708.js
+++ b/test/mjsunit/regress/regress-crbug-336148.js
@@ -27,16 +27,30 @@
// Flags: --allow-natives-syntax
-function foo(x, y) {
- return Math.floor(x / y);
+function f(o) {
+ var a = 1;
+ if (true) return o.v && a;
}
-function bar(x, y) {
- return foo(x + 1, y + 1);
-}
+f({});
+f({});
+%OptimizeFunctionOnNextCall(f);
+assertEquals(1, f({ v: 1 }));
+
-foo(16, "4");
+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());
+}
-bar(64, 2);
-%OptimizeFunctionOnNextCall(bar);
-bar(64, 2);
+test();
+test();
+[f1, f2, f3, f4].forEach(function(f) { %OptimizeFunctionOnNextCall(f); });
+test();
« no previous file with comments | « src/version.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698