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