Serializer forces flushing of optimized code map.

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}
This commit is contained in:
mstarzinger 2015-07-03 00:47:26 -07:00 committed by Commit bot
parent 0a5b6ad755
commit 84f0a33ce0

View 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();