From 84f0a33ce0020f16514b8c01ff2bbe8b027e027e Mon Sep 17 00:00:00 2001 From: mstarzinger Date: Fri, 3 Jul 2015 00:47:26 -0700 Subject: [PATCH] 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} --- src/heap/objects-visiting-inl.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h index 01a38cb5c..ed6db7b9b 100644 --- a/src/heap/objects-visiting-inl.h +++ b/src/heap/objects-visiting-inl.h @@ -409,7 +409,8 @@ void StaticMarkingVisitor::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(); -- 2.34.1