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(); |
+ |