Chromium Code Reviews| Index: src/heap/objects-visiting-inl.h |
| diff --git a/src/heap/objects-visiting-inl.h b/src/heap/objects-visiting-inl.h |
| index 86f6d01940a0c7b9126e439a8b1392ca71ae51da..4b8e27d450e6a8d76b4216d882590ef0879aa867 100644 |
| --- a/src/heap/objects-visiting-inl.h |
| +++ b/src/heap/objects-visiting-inl.h |
| @@ -443,23 +443,23 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
| if (FLAG_cleanup_code_caches_at_gc) { |
| shared->ClearTypeFeedbackInfoAtGCTime(); |
| } |
| - 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(); |
| - } |
| - MarkCompactCollector* collector = heap->mark_compact_collector(); |
| - if (collector->is_code_flushing_enabled()) { |
| + if (FLAG_flush_optimized_code_cache || |
| + heap->isolate()->serializer_enabled()) { |
| + if (!shared->optimized_code_map()->IsSmi()) { |
| + // Always flush the optimized code map if requested by flag. |
| + shared->ClearOptimizedCodeMap(); |
| + } |
| + } else { |
| if (!shared->optimized_code_map()->IsSmi()) { |
| - // Add the shared function info holding an optimized code map to |
| - // the code flusher for processing of code maps after marking. |
| - collector->code_flusher()->AddOptimizedCodeMap(shared); |
| // Treat some references within the code map weakly by marking the |
| - // code map itself but not pushing it onto the marking deque. |
| + // code map itself but not pushing it onto the marking deque. The |
| + // map will be processed after marking. |
| FixedArray* code_map = FixedArray::cast(shared->optimized_code_map()); |
| MarkOptimizedCodeMap(heap, code_map); |
|
ulan
2015/11/05 13:23:17
Not related to the CL: there is a potential memory
Michael Starzinger
2015/11/05 13:51:03
Acknowledged. As discussed offline: Yes, you are a
|
| } |
| + } |
| + MarkCompactCollector* collector = heap->mark_compact_collector(); |
| + if (collector->is_code_flushing_enabled()) { |
| if (IsFlushable(heap, shared)) { |
| // This function's code looks flushable. But we have to postpone |
| // the decision until we see all functions that point to the same |
| @@ -473,6 +473,7 @@ void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
| return; |
| } |
| } else { |
| + // TODO(mstarzinger): Drop this case, it shouldn't be done here! |
| if (!shared->optimized_code_map()->IsSmi()) { |
| // Flush optimized code map on major GCs without code flushing, |
| // needed because cached code doesn't contain breakpoints. |