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

Unified Diff: test/mjsunit/compiler/deopt-arguments-oob.js

Issue 2481053002: [crankshaft] Fix deoptimization loop w/ non-monomorphic arguments access. (Closed)
Patch Set: Created 4 years, 1 month 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/crankshaft/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/compiler/deopt-arguments-oob.js
diff --git a/test/mjsunit/compiler/deopt-arguments-oob.js b/test/mjsunit/compiler/deopt-arguments-oob.js
new file mode 100644
index 0000000000000000000000000000000000000000..6995af6fc372a71ba03e58301ae0c4b160aeb5ca
--- /dev/null
+++ b/test/mjsunit/compiler/deopt-arguments-oob.js
@@ -0,0 +1,27 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --allow-natives-syntax
+
+function foo() { return arguments[0]; }
+
+// Warm up with monomorphic access.
+foo(0);
+foo(1);
+%BaselineFunctionOnNextCall(foo);
+foo(2);
+foo(3);
+%OptimizeFunctionOnNextCall(foo);
+
+// Mess with out-of-bounds accesses.
+for (var i = 0; i < 50000; ++i) {
+ foo();
+}
+
+// Optimization shall stabilize now.
+var count = %GetOptimizationCount(foo);
+for (var i = 0; i < 50000; ++i) {
+ foo();
+}
+assertEquals(count, %GetOptimizationCount(foo));
« no previous file with comments | « src/crankshaft/hydrogen.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698