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

Unified Diff: test/mjsunit/regress/regress-2539.js

Issue 12255033: Fix f.apply() optimization when declared arguments are mutated. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comments by Toon Verwaest. Created 7 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/compiler/inline-function-apply.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-2539.js
diff --git a/test/mjsunit/regress/regress-2489.js b/test/mjsunit/regress/regress-2539.js
similarity index 80%
copy from test/mjsunit/regress/regress-2489.js
copy to test/mjsunit/regress/regress-2539.js
index 882c4f794a88e24d1d64e86a466b27c39f51e625..5d263f8912bb7f44083d159cfead81ba33a3a3b4 100644
--- a/test/mjsunit/regress/regress-2489.js
+++ b/test/mjsunit/regress/regress-2539.js
@@ -28,23 +28,28 @@
// Flags: --allow-natives-syntax
"use strict";
+var dispatcher = {};
+dispatcher.func = C;
-function f(a, b) {
- return g("c", "d");
+function A() {
+ B(10, 11);
}
-function g(a, b) {
- g.constructor.apply(this, arguments);
+function B(x,y) {
+ x = 0; y = 0;
+ dispatcher.func.apply(this, arguments);
+ assertSame(2, arguments.length);
+ assertSame(10, arguments[0]);
+ assertSame(11, arguments[1]);
}
-g.constructor = function(a, b) {
- assertEquals("c", a);
- assertEquals("d", b);
+function C(x,y) {
+ assertSame(2, arguments.length);
+ assertSame(10, arguments[0]);
+ assertSame(11, arguments[1]);
}
-f("a", "b");
-f("a", "b");
-%OptimizeFunctionOnNextCall(f);
-f("a", "b");
-g.x = "deopt";
-f("a", "b");
+A();
+A();
+%OptimizeFunctionOnNextCall(A);
+A();
« no previous file with comments | « test/mjsunit/compiler/inline-function-apply.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698