Serializer forces flushing of optimized code map.
authormstarzinger <mstarzinger@chromium.org>
Fri, 3 Jul 2015 07:47:26 +0000 (00:47 -0700)
committerCommit bot <commit-bot@chromium.org>
Fri, 3 Jul 2015 07:47:43 +0000 (07:47 +0000)
This makes sure that the GC fully flushes the optimized code map when
the serializer is preparing a snapshot. Otherwise closures and contexts
could end up in the startup snapshot.

R=hpayer@chromium.org
TEST=cctest/test-serialize/SerializeInternalReference

Review URL: https://codereview.chromium.org/1215063007

Cr-Commit-Position: refs/heads/master@{#29461}

src/heap/objects-visiting-inl.h

index 01a38cb..ed6db7b 100644 (file)
@@ -409,7 +409,8 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo(
   if (FLAG_cleanup_code_caches_at_gc) {
     shared->ClearTypeFeedbackInfoAtGCTime();
   }
-  if (FLAG_flush_optimized_code_cache &&
+  if ((FLAG_flush_optimized_code_cache ||
+       heap->isolate()->serializer_enabled()) &&
       !shared->optimized_code_map()->IsSmi()) {
     // Always flush the optimized code map if requested by flag.
     shared->ClearOptimizedCodeMap();