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

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

Issue 23480031: Enable preaging of code objects when --optimize-for-size. (Closed) Base URL: https://v8.googlecode.com/svn/trunk
Patch Set: Make pre-aging conditional on is_memory_constrained() Created 7 years, 3 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
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 64075d26b4367bf17939c26c972b98bc2c868549..0576fc7ffefb98c5fb4449fe5fc2e0fcb95d2380 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -1061,8 +1061,8 @@ TEST(TestCodeFlushing) {
Handle<JSFunction> function(JSFunction::cast(func_value));
CHECK(function->shared()->is_compiled());
- // The code will survive at least two GCs.
- HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
+ // The code will survive at least one GC (it will be pre-aged so may not
+ // survive further).
Hannes Payer (out of office) 2013/09/16 14:31:45 Since we have the mode now which is turned on on m
rmcilroy 2013/09/16 15:45:47 Sounds like a plan. Done.
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
CHECK(function->shared()->is_compiled());
@@ -1110,7 +1110,17 @@ TEST(TestCodeFlushingIncremental) {
Handle<JSFunction> function(JSFunction::cast(func_value));
CHECK(function->shared()->is_compiled());
- // The code will survive at least two GCs.
+ // The code will survive at least one GC (it will be pre-aged so may not
+ // survive further).
+ HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
+ CHECK(function->shared()->is_compiled());
+
+ // Execute the function again to ensure it is reset to the young age.
+ { v8::HandleScope scope(CcTest::isolate());
+ CompileRun("foo();");
+ }
+
+ // The code will survive at least two GC now that it is young again.
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
CHECK(function->shared()->is_compiled());
@@ -1247,9 +1257,9 @@ TEST(TestCodeFlushingIncrementalAbort) {
Handle<JSFunction> function(JSFunction::cast(func_value));
CHECK(function->shared()->is_compiled());
- // The code will survive at least two GCs.
- heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
- heap->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
+ // The code will survive at least one GC (it will be pre-aged so may not
+ // survive further).
+ HEAP->CollectAllGarbage(Heap::kAbortIncrementalMarkingMask);
CHECK(function->shared()->is_compiled());
// Bump the code age so that flushing is triggered.
« no previous file with comments | « src/x64/lithium-codegen-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698