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

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

Issue 11438042: Allow lazy compilation (and thus optimisation) of functions inside eval. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed copyright date Created 8 years 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/regress-2315.js
diff --git a/test/mjsunit/fast-array-length.js b/test/mjsunit/regress/regress-2315.js
similarity index 87%
copy from test/mjsunit/fast-array-length.js
copy to test/mjsunit/regress/regress-2315.js
index 42f2c38f49b1dd3a3c0ffa867f7db368df78e760..ddc9618e1beff6cb0c076cc7f1d89b56474ae4bc 100644
--- a/test/mjsunit/fast-array-length.js
+++ b/test/mjsunit/regress/regress-2315.js
@@ -27,11 +27,12 @@
// Flags: --allow-natives-syntax
-// This is a regression test for overlapping key and value registers.
+var foo = (function() {
+ return eval("(function bar() { return 1; })");
+})();
+for (var i = 0; i < 10; ++i) foo();
Michael Starzinger 2012/12/07 09:50:17 Is there a particular reason we need two separate
rossberg 2012/12/07 10:23:33 Now using %OptimizeFunctionOnNextCall instead.
+for (var i = 0; i < 10000; ++i) foo();
-var a = [0, 1, 2, 3, 4, 5];
-assertTrue(%HasFastSmiElements(a));
-a.length = (1 << 30);
-assertFalse(%HasFastSmiElements(a));
-
+// Function should be optimized now.
+assertTrue(%GetOptimizationStatus(foo) != 2);

Powered by Google App Engine
This is Rietveld 408576698