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

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

Issue 13649003: Fix worst-case behavior of MergeRemovableSimulates(). (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: small changes. Created 7 years, 9 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
« src/hydrogen.cc ('K') | « test/mjsunit/mjsunit.status ('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-2612.js
diff --git a/test/mjsunit/parallel-optimize-disabled.js b/test/mjsunit/regress/regress-2612.js
similarity index 63%
copy from test/mjsunit/parallel-optimize-disabled.js
copy to test/mjsunit/regress/regress-2612.js
index 86b375c53aef0c9118c7dbd57ad25f1dc593dda5..06db07733d393f5327be977c56d2b764fbe1f0b1 100644
--- a/test/mjsunit/parallel-optimize-disabled.js
+++ b/test/mjsunit/regress/regress-2612.js
@@ -25,22 +25,52 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-// Flags: --nodead-code-elimination --parallel-recompilation
-// Flags: --allow-natives-syntax
+// Flags: --allow-natives-syntax --nodead-code-elimination
+// Flags: --nofold-constants --nouse-gvn
-function g() { // g() cannot be optimized.
- const x = 1;
- x++;
+// Create a function to get a long series of removable simulates.
+// f() {
+// var _0 = <random>, _1 = <random>, ... _1000 = <random>,
+// _1001 = <random var> + <random var>,
+// _1002 = <random var> + <random var>,
+// ...
+// _99999 = <random var> + <random var>,
+// x = 1;
+// return _0;
+// }
+
+var seed = 1;
+
+function rand() {
+ seed = seed * 171 % 1337 + 17;
+ return (seed % 1000) / 1000;
}
-function f(x) {
- g();
+function randi(max) {
+ seed = seed * 131 % 1773 + 13;
+ return seed % max;
}
-f();
+function varname(i) {
+ return "_" + i;
+}
+
+var source = "var ";
+
+for (var i = 0; i < 1000; i++) {
+ source += [varname(i), "=", rand(), ","].join("");
+}
+
+for (var i = 1000; i < 100000; i++) {
+ source += [varname(i), "=",
+ varname(randi(i)), "+",
+ varname(randi(i)), ","].join("");
+}
+
+source += "x=1; return _0;"
+var f = new Function(source);
+
f();
%OptimizeFunctionOnNextCall(f);
-%OptimizeFunctionOnNextCall(g, "parallel");
-f(0); // g() is disabled for optimization on inlining attempt.
-// Attempt to optimize g() should not run into any assertion.
-%WaitUntilOptimized(g);
+f();
+
« src/hydrogen.cc ('K') | « test/mjsunit/mjsunit.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698