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

Unified Diff: test/cctest/test-strings.cc

Issue 11565031: Make string test resilient against GC stress. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-strings.cc
diff --git a/test/cctest/test-strings.cc b/test/cctest/test-strings.cc
index 4fb32d5b861ade3bebd27cf5f5ac4111d4a67887..6f0f96df906cf147f15d9f8d0ba42a6c42d12f9b 100644
--- a/test/cctest/test-strings.cc
+++ b/test/cctest/test-strings.cc
@@ -671,10 +671,10 @@ void TestStringCharacterStream(BuildString build, int test_cases) {
HandleScope outer_scope(isolate);
ZoneScope zone(Isolate::Current()->runtime_zone(), DELETE_ON_EXIT);
ConsStringGenerationData data(true);
- bool last_test_did_gc = false;
for (int i = 0; i < test_cases; i++) {
printf("%d\n", i);
HandleScope inner_scope(isolate);
+ AlwaysAllocateScope always_allocate;
// Build flat version of cons string.
Handle<String> flat_string = build(i, &data);
ConsStringStats flat_string_stats;
@@ -685,22 +685,6 @@ void TestStringCharacterStream(BuildString build, int test_cases) {
Handle<String> cons_string = build(i, &data);
ConsStringStats cons_string_stats;
AccumulateStats(cons_string, &cons_string_stats);
- // Check if gc changed our data structure.
- bool broken_by_gc =
- cons_string_stats.leaves_ != data.stats_.leaves_ ||
- cons_string_stats.leaves_ != flat_string_stats.leaves_;
- // If gc altered the data structure, do a full collection and retry test.
- if (broken_by_gc) {
- // Bail if test runs twice.
- if (last_test_did_gc) CHECK(false);
- printf("forcing gc\n");
- isolate->heap()->CollectAllGarbage(Heap::kNoGCFlags, "retry test");
- // Retry test.
- last_test_did_gc = true;
- i--;
- continue;
- }
- last_test_did_gc = false;
AssertNoAllocation no_alloc;
PrintStats(data);
// Full verify of cons string.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698