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

Unified Diff: test/mjsunit/regress/binop-in-effect-context-deopt.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
Index: test/mjsunit/regress/binop-in-effect-context-deopt.js
diff --git a/test/mjsunit/regress/regress-331416.js b/test/mjsunit/regress/binop-in-effect-context-deopt.js
similarity index 69%
copy from test/mjsunit/regress/regress-331416.js
copy to test/mjsunit/regress/binop-in-effect-context-deopt.js
index 0c60fced14e1c185919985fd011c9ca46d93ff3f..fb7280a0d1128c6baad81e759aad6b6bec3c6528 100644
--- a/test/mjsunit/regress/regress-331416.js
+++ b/test/mjsunit/regress/binop-in-effect-context-deopt.js
@@ -27,26 +27,39 @@
// Flags: --allow-natives-syntax
-function load(a, i) {
- return a[i];
-}
-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;
-}
-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);
+(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();
+})();
« no previous file with comments | « test/mjsunit/regress-sync-optimized-lists.js ('k') | test/mjsunit/regress/call-function-in-effect-context-deopt.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698