Index: test/mjsunit/regress/regress-embedded-cons-string.js |
diff --git a/test/mjsunit/parallel-invalidate-transition-map.js b/test/mjsunit/regress/regress-embedded-cons-string.js |
similarity index 73% |
copy from test/mjsunit/parallel-invalidate-transition-map.js |
copy to test/mjsunit/regress/regress-embedded-cons-string.js |
index 2a2276f1e238bb1c19efe07ff50262d0e983fae6..afb3835688565986e45452d038866025ae11b0f0 100644 |
--- a/test/mjsunit/parallel-invalidate-transition-map.js |
+++ b/test/mjsunit/regress/regress-embedded-cons-string.js |
@@ -25,8 +25,9 @@ |
// (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: --track-fields --track-double-fields --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=300 |
if (!%IsParallelRecompilationSupported()) { |
print("Parallel recompilation is disabled. Skipping this test."); |
@@ -37,25 +38,29 @@ function assertUnoptimized(fun) { |
assertTrue(%GetOptimizationStatus(fun) != 1); |
} |
-function new_object() { |
- var o = {}; |
- o.a = 1; |
- o.b = 2; |
- return o; |
+function test(fun) { |
+ fun(); |
+ fun(); |
+ %OptimizeFunctionOnNextCall(fun, "parallel"); |
+ fun(); // Trigger optimization in the background. |
+ gc(); // Tenure cons string. |
+ assertUnoptimized(fun); // Compilation not complete yet. |
+ %CompleteOptimization(fun); // Compilation embeds tenured cons string. |
+ gc(); // Visit embedded cons string during mark compact. |
} |
-function add_field(obj) { |
- obj.c = 3; |
+function f() { |
+ return "abcdefghijklmn" + "123456789"; |
} |
-add_field(new_object()); |
-add_field(new_object()); |
-%OptimizeFunctionOnNextCall(add_field, "parallel"); |
+function g() { |
+ return "abcdefghijklmn\u2603" + "123456789"; |
+} |
-var o = new_object(); |
-add_field(o); // Trigger optimization. |
-assertUnoptimized(add_field); // Not yet optimized. |
-o.c = 2.2; // Invalidate transition map. |
-%CompleteOptimization(add_field); // Conclude optimization with... |
-assertUnoptimized(add_field); // ... bailing out due to map dependency. |
+function h() { |
+ return "abcdefghijklmn\u2603" + "123456789\u2604"; |
+} |
+test(f); |
+test(g); |
+test(h); |