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

Unified Diff: test/mjsunit/arguments-apply-deopt.js

Issue 133773002: Fix of Hydrogen environment building for function "apply" calls (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Nanotweak 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 | « 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/arguments-apply-deopt.js
diff --git a/test/mjsunit/regress/regress-crbug-150545.js b/test/mjsunit/arguments-apply-deopt.js
similarity index 66%
copy from test/mjsunit/regress/regress-crbug-150545.js
copy to test/mjsunit/arguments-apply-deopt.js
index 8238d2fa0d36ffd40be60628d333f5dcb1f0ba51..b7251af5aa1567087d7bb9d333dc1fed2f3ecb89 100644
--- a/test/mjsunit/regress/regress-crbug-150545.js
+++ b/test/mjsunit/arguments-apply-deopt.js
@@ -27,29 +27,51 @@
// Flags: --allow-natives-syntax
-// Test that we do not generate OSR entry points that have an arguments
-// stack height different from zero. The OSR machinery cannot generate
-// frames for that.
-
-(function() {
- "use strict";
-
- var instantReturn = false;
- function inner() {
- if (instantReturn) return;
- assertSame(3, arguments.length);
- assertSame(1, arguments[0]);
- assertSame(2, arguments[1]);
- assertSame(3, arguments[2]);
+(function ApplyArgumentsDeoptInReceiverMapCheck() {
+ function invoker(h, r) {
+ return function XXXXX() {
+ var res = h.apply({ fffffff : r(this) }, arguments);
+ return res;
+ };
}
- function outer() {
- inner(1,2,3);
- // Trigger OSR, if optimization is not disabled.
- if (%GetOptimizationStatus(outer) != 4) {
- while (%GetOptimizationCount(outer) == 0) {}
- }
+ var y = invoker(m, selfOf);
+
+ function selfOf(c) {
+ var sssss = c.self_;
+ return sssss;
+ }
+
+ function m() {
+ return this.fffffff;
}
- outer();
+ y.apply({ self_ : 3 });
+ y.apply({ self_ : 3 });
+ y.apply({ self_ : 3 });
+
+ %OptimizeFunctionOnNextCall(y);
+
+ assertEquals(y.apply({ self_ : 3, uuu : 4 }), 3);
+})();
+
+(function ApplyArgumentsDeoptInReceiverExplicit() {
+ function f() { return this + 21; }
+
+ function deopt() {
+ %DeoptimizeFunction(XXXXX);
+ return 21;
+ }
+
+ function XXXXX() {
+ return f.apply(deopt(), arguments);
+ };
+
+ XXXXX();
+ XXXXX();
+ XXXXX();
+
+ %OptimizeFunctionOnNextCall(XXXXX);
+
+ assertEquals(42, XXXXX());
})();
« no previous file with comments | « src/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698