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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 Map* map, HeapObject* object) { | 451 Map* map, HeapObject* object) { |
452 Heap* heap = map->GetHeap(); | 452 Heap* heap = map->GetHeap(); |
453 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); | 453 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); |
454 if (shared->ic_age() != heap->global_ic_age()) { | 454 if (shared->ic_age() != heap->global_ic_age()) { |
455 shared->ResetForNewContext(heap->global_ic_age()); | 455 shared->ResetForNewContext(heap->global_ic_age()); |
456 } | 456 } |
457 if (FLAG_cleanup_code_caches_at_gc) { | 457 if (FLAG_cleanup_code_caches_at_gc) { |
458 shared->ClearTypeFeedbackInfoAtGCTime(); | 458 shared->ClearTypeFeedbackInfoAtGCTime(); |
459 } | 459 } |
460 if (FLAG_flush_optimized_code_cache) { | 460 if (FLAG_flush_optimized_code_cache) { |
461 if (!shared->optimized_code_map()->IsSmi()) { | 461 if (!shared->OptimizedCodeMapIsCleared()) { |
462 // Always flush the optimized code map if requested by flag. | 462 // Always flush the optimized code map if requested by flag. |
463 shared->ClearOptimizedCodeMap(); | 463 shared->ClearOptimizedCodeMap(); |
464 } | 464 } |
465 } else { | 465 } else { |
466 if (!shared->optimized_code_map()->IsSmi()) { | 466 if (!shared->OptimizedCodeMapIsCleared()) { |
467 // Treat some references within the code map weakly by marking the | 467 // Treat some references within the code map weakly by marking the |
468 // code map itself but not pushing it onto the marking deque. The | 468 // code map itself but not pushing it onto the marking deque. The |
469 // map will be processed after marking. | 469 // map will be processed after marking. |
470 FixedArray* code_map = FixedArray::cast(shared->optimized_code_map()); | 470 FixedArray* code_map = shared->optimized_code_map(); |
471 MarkOptimizedCodeMap(heap, code_map); | 471 MarkOptimizedCodeMap(heap, code_map); |
472 } | 472 } |
473 } | 473 } |
474 MarkCompactCollector* collector = heap->mark_compact_collector(); | 474 MarkCompactCollector* collector = heap->mark_compact_collector(); |
475 if (collector->is_code_flushing_enabled()) { | 475 if (collector->is_code_flushing_enabled()) { |
476 if (IsFlushable(heap, shared)) { | 476 if (IsFlushable(heap, shared)) { |
477 // This function's code looks flushable. But we have to postpone | 477 // This function's code looks flushable. But we have to postpone |
478 // the decision until we see all functions that point to the same | 478 // the decision until we see all functions that point to the same |
479 // SharedFunctionInfo because some of them might be optimized. | 479 // SharedFunctionInfo because some of them might be optimized. |
480 // That would also make the non-optimized version of the code | 480 // That would also make the non-optimized version of the code |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
821 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 821 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
822 void> JSFunctionWeakCodeBodyVisitor; | 822 void> JSFunctionWeakCodeBodyVisitor; |
823 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 823 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
824 } | 824 } |
825 | 825 |
826 | 826 |
827 } // namespace internal | 827 } // namespace internal |
828 } // namespace v8 | 828 } // namespace v8 |
829 | 829 |
830 #endif // V8_OBJECTS_VISITING_INL_H_ | 830 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |