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

Unified Diff: test/mjsunit/regress/regress-embedded-cons-string.js

Issue 17418003: Short-circuit embedded cons strings. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: update reloc target Created 7 years, 6 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/objects-visiting-inl.h ('K') | « src/objects-visiting-inl.h ('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-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 74%
copy from test/mjsunit/compiler/parallel-proto-change.js
copy to test/mjsunit/regress/regress-embedded-cons-string.js
index 2392a37c95504e94c6688e9d048118e0e376c77a..9dc4ab8034218c6546b4de64d64a7ee2db7a02a1 100644
--- a/test/mjsunit/compiler/parallel-proto-change.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: --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,19 +38,21 @@ function assertUnoptimized(fun) {
assertTrue(%GetOptimizationStatus(fun) != 1);
}
-function f(foo) { return foo.bar(); }
+function f() {
+ return "abcdefghijklmn" + "123456789"; // Constant-folds to a cons string.
+}
-var o = {};
-o.__proto__ = { __proto__: { bar: function() { return 1; } } };
+f();
+f();
+%OptimizeFunctionOnNextCall(f, "parallel");
+f(); // Trigger optimization in the background.
+gc(); // Tenure cons string.
+assertUnoptimized(f); // Compilation not complete yet.
+%CompleteOptimization(f); // Compilation embeds tenured cons string.
-assertEquals(1, f(o));
-assertEquals(1, f(o));
+gc(); // Visit embedded cons string during mark compact.
+assertEquals("abcdefghijklmn123456789", f());
+%FlattenString(f());
+gc(); // Short circuit flattened cons string during visit.
+assertEquals("abcdefghijklmn123456789", f());
-%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));
« src/objects-visiting-inl.h ('K') | « src/objects-visiting-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698