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

Unified Diff: test/mjsunit/regress/regress-array-pop-deopt.js

Issue 138443012: Reland ArrayPop / ArrayPush. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 11 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/object-seal.js ('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-array-pop-deopt.js
diff --git a/test/mjsunit/regress/regress-334708.js b/test/mjsunit/regress/regress-array-pop-deopt.js
similarity index 89%
copy from test/mjsunit/regress/regress-334708.js
copy to test/mjsunit/regress/regress-array-pop-deopt.js
index f0291bbdab61128baad9df89457d045b66644f1b..9a0d35d3aa61b0bd3a05971b90f7c7544084d76c 100644
--- a/test/mjsunit/regress/regress-334708.js
+++ b/test/mjsunit/regress/regress-array-pop-deopt.js
@@ -27,16 +27,15 @@
// Flags: --allow-natives-syntax
-function foo(x, y) {
- return Math.floor(x / y);
-}
+var o = [6,7,8,9];
-function bar(x, y) {
- return foo(x + 1, y + 1);
+function f(b) {
+ var v = o.pop() + b;
+ return v;
}
-foo(16, "4");
-
-bar(64, 2);
-%OptimizeFunctionOnNextCall(bar);
-bar(64, 2);
+assertEquals(10, f(1));
+assertEquals(9, f(1));
+assertEquals(8, f(1));
+%OptimizeFunctionOnNextCall(f);
+assertEquals("61", f("1"));
« no previous file with comments | « test/mjsunit/object-seal.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698