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

Unified Diff: test/mjsunit/regress/binop-in-effect-context-deopt.js

Issue 132453009: Binary operation deoptimization fix. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor tweaks + added test 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
« src/hydrogen.cc ('K') | « src/hydrogen.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/binop-in-effect-context-deopt.js
diff --git a/test/mjsunit/regress/regress-crbug-336148.js b/test/mjsunit/regress/binop-in-effect-context-deopt.js
similarity index 70%
copy from test/mjsunit/regress/regress-crbug-336148.js
copy to test/mjsunit/regress/binop-in-effect-context-deopt.js
index 8157c9fcc1978c632a32f1930af56cf113276bcc..fb7280a0d1128c6baad81e759aad6b6bec3c6528 100644
--- a/test/mjsunit/regress/regress-crbug-336148.js
+++ b/test/mjsunit/regress/binop-in-effect-context-deopt.js
@@ -27,30 +27,39 @@
// Flags: --allow-natives-syntax
-function f(o) {
- var a = 1;
- if (true) return o.v && a;
-}
-
-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());
-}
-
-test();
-test();
-[f1, f2, f3, f4].forEach(function(f) { %OptimizeFunctionOnNextCall(f); });
-test();
+(function BinopInEffectContextDeoptAndOsr() {
+ function f(a, deopt, osr) {
+ var result = (a + 10, "result");
+ var dummy = deopt + 0;
+ if (osr) while (%GetOptimizationStatus(f) == 2) {}
+ return result;
+ }
+
+ assertEquals("result", f(true, 3, false));
+ assertEquals("result", f(true, 3, false));
+ %OptimizeFunctionOnNextCall(f);
+ assertEquals("result", f(true, "foo", true));
+})();
+
+
+(function BinopInEffectContextLazyDeopt() {
+ function deopt_f() {
+ %DeoptimizeFunction(f);
+ return "dummy";
+ }
+
+ function h() {
+ return { toString : deopt_f };
+ }
+
+ function g(x) {
+ }
+
+ function f() {
+ return g(void(h() + ""));
+ };
+
+ f();
+ %OptimizeFunctionOnNextCall(f);
+ f();
+})();
« src/hydrogen.cc ('K') | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698