OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_OBJECTS_VISITING_INL_H_ | 5 #ifndef V8_OBJECTS_VISITING_INL_H_ |
6 #define V8_OBJECTS_VISITING_INL_H_ | 6 #define V8_OBJECTS_VISITING_INL_H_ |
7 | 7 |
8 #include "src/heap/array-buffer-tracker.h" | 8 #include "src/heap/array-buffer-tracker.h" |
9 #include "src/heap/objects-visiting.h" | 9 #include "src/heap/objects-visiting.h" |
10 #include "src/ic/ic-state.h" | 10 #include "src/ic/ic-state.h" |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 | 452 |
453 | 453 |
454 template <typename StaticVisitor> | 454 template <typename StaticVisitor> |
455 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( | 455 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
456 Map* map, HeapObject* object) { | 456 Map* map, HeapObject* object) { |
457 Heap* heap = map->GetHeap(); | 457 Heap* heap = map->GetHeap(); |
458 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); | 458 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); |
459 if (shared->ic_age() != heap->global_ic_age()) { | 459 if (shared->ic_age() != heap->global_ic_age()) { |
460 shared->ResetForNewContext(heap->global_ic_age()); | 460 shared->ResetForNewContext(heap->global_ic_age()); |
461 } | 461 } |
462 if (FLAG_cleanup_code_caches_at_gc) { | |
463 shared->ClearTypeFeedbackInfoAtGCTime(); | |
464 } | |
465 if (FLAG_flush_optimized_code_cache) { | 462 if (FLAG_flush_optimized_code_cache) { |
466 if (!shared->OptimizedCodeMapIsCleared()) { | 463 if (!shared->OptimizedCodeMapIsCleared()) { |
467 // Always flush the optimized code map if requested by flag. | 464 // Always flush the optimized code map if requested by flag. |
468 shared->ClearOptimizedCodeMap(); | 465 shared->ClearOptimizedCodeMap(); |
469 } | 466 } |
470 } | 467 } |
471 MarkCompactCollector* collector = heap->mark_compact_collector(); | 468 MarkCompactCollector* collector = heap->mark_compact_collector(); |
472 if (collector->is_code_flushing_enabled()) { | 469 if (collector->is_code_flushing_enabled()) { |
473 if (IsFlushable(heap, shared)) { | 470 if (IsFlushable(heap, shared)) { |
474 // This function's code looks flushable. But we have to postpone | 471 // This function's code looks flushable. But we have to postpone |
(...skipping 10 matching lines...) Expand all Loading... |
485 } | 482 } |
486 VisitSharedFunctionInfoStrongCode(heap, object); | 483 VisitSharedFunctionInfoStrongCode(heap, object); |
487 } | 484 } |
488 | 485 |
489 | 486 |
490 template <typename StaticVisitor> | 487 template <typename StaticVisitor> |
491 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map, | 488 void StaticMarkingVisitor<StaticVisitor>::VisitJSFunction(Map* map, |
492 HeapObject* object) { | 489 HeapObject* object) { |
493 Heap* heap = map->GetHeap(); | 490 Heap* heap = map->GetHeap(); |
494 JSFunction* function = JSFunction::cast(object); | 491 JSFunction* function = JSFunction::cast(object); |
| 492 if (FLAG_cleanup_code_caches_at_gc) { |
| 493 function->ClearTypeFeedbackInfoAtGCTime(); |
| 494 } |
495 MarkCompactCollector* collector = heap->mark_compact_collector(); | 495 MarkCompactCollector* collector = heap->mark_compact_collector(); |
496 if (collector->is_code_flushing_enabled()) { | 496 if (collector->is_code_flushing_enabled()) { |
497 if (IsFlushable(heap, function)) { | 497 if (IsFlushable(heap, function)) { |
498 // This function's code looks flushable. But we have to postpone | 498 // This function's code looks flushable. But we have to postpone |
499 // the decision until we see all functions that point to the same | 499 // the decision until we see all functions that point to the same |
500 // SharedFunctionInfo because some of them might be optimized. | 500 // SharedFunctionInfo because some of them might be optimized. |
501 // That would also make the non-optimized version of the code | 501 // That would also make the non-optimized version of the code |
502 // non-flushable, because it is required for bailing out from | 502 // non-flushable, because it is required for bailing out from |
503 // optimized code. | 503 // optimized code. |
504 collector->code_flusher()->AddCandidate(function); | 504 collector->code_flusher()->AddCandidate(function); |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
731 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 731 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
732 void> JSFunctionWeakCodeBodyVisitor; | 732 void> JSFunctionWeakCodeBodyVisitor; |
733 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 733 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
734 } | 734 } |
735 | 735 |
736 | 736 |
737 } // namespace internal | 737 } // namespace internal |
738 } // namespace v8 | 738 } // namespace v8 |
739 | 739 |
740 #endif // V8_OBJECTS_VISITING_INL_H_ | 740 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |