Index: test/mjsunit/regress/regress-embedded-cons-string.js |
diff --git a/test/mjsunit/compiler/parallel-proto-change.js b/test/mjsunit/regress/regress-embedded-cons-string.js |
similarity index 71% |
copy from test/mjsunit/compiler/parallel-proto-change.js |
copy to test/mjsunit/regress/regress-embedded-cons-string.js |
index aa1ac6de90952c3a0f5e2e3ea28c4f1d1dcdd9f1..5810bf01f3b1f3a93267674e3a37a84ee9d44c94 100644 |
--- a/test/mjsunit/compiler/parallel-proto-change.js |
+++ b/test/mjsunit/regress/regress-embedded-cons-string.js |
@@ -25,26 +25,25 @@ |
// (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: --allow-natives-syntax |
-// Flags: --parallel-recompilation --parallel-recompilation-delay=50 |
+// Flags: --fold-constants --nodead-code-elimination |
+// Flags: --expose-gc --allow-natives-syntax |
+// Flags: --parallel-recompilation --parallel-recompilation-delay=200 |
-function assertUnoptimized(fun) { |
- assertTrue(%GetOptimizationStatus(fun) != 1); |
+function f() { |
+ return "abcdefghijklmn" + "123456789"; // Constant-folds to a cons string. |
} |
-function f(foo) { return foo.bar(); } |
+f(); |
+f(); |
+%OptimizeFunctionOnNextCall(f, "parallel"); |
+f(); // Trigger optimization in the background. |
+gc(); // Tenure cons string. |
+%CompleteOptimization(f); // Compilation embeds tenured cons string. |
-var o = {}; |
-o.__proto__ = { __proto__: { bar: function() { return 1; } } }; |
+gc(); // Visit embedded cons string during mark compact. |
+assertEquals("abcdefghijklmn123456789", f()); |
+%FlattenString(f()); |
+gc(); // Short circuit flattened cons string during visit. |
+assertEquals("abcdefghijklmn123456789", f()); |
-assertEquals(1, f(o)); |
-assertEquals(1, f(o)); |
-%OptimizeFunctionOnNextCall(f, "parallel"); |
-assertEquals(1, f(o)); // Trigger optimization. |
-assertUnoptimized(f); // Optimization not yet done. |
-// Change the prototype chain during optimization to trigger map invalidation. |
-o.__proto__.__proto__ = { bar: function() { return 2; } }; |
-%CompleteOptimization(f); // Conclude optimization with... |
-assertUnoptimized(f); // ... bailing out due to map dependency. |
-assertEquals(2, f(o)); |