| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset), | 419 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset), |
| 420 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset)); | 420 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset)); |
| 421 } | 421 } |
| 422 | 422 |
| 423 | 423 |
| 424 template<typename StaticVisitor> | 424 template<typename StaticVisitor> |
| 425 void StaticMarkingVisitor<StaticVisitor>::VisitCode( | 425 void StaticMarkingVisitor<StaticVisitor>::VisitCode( |
| 426 Map* map, HeapObject* object) { | 426 Map* map, HeapObject* object) { |
| 427 Heap* heap = map->GetHeap(); | 427 Heap* heap = map->GetHeap(); |
| 428 Code* code = Code::cast(object); | 428 Code* code = Code::cast(object); |
| 429 if (FLAG_cleanup_code_caches_at_gc) { | |
| 430 code->ClearTypeFeedbackInfo(heap); | |
| 431 } | |
| 432 if (FLAG_age_code && !Serializer::enabled()) { | 429 if (FLAG_age_code && !Serializer::enabled()) { |
| 433 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); | 430 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); |
| 434 } | 431 } |
| 435 code->CodeIterateBody<StaticVisitor>(heap); | 432 code->CodeIterateBody<StaticVisitor>(heap); |
| 436 } | 433 } |
| 437 | 434 |
| 438 | 435 |
| 439 template<typename StaticVisitor> | 436 template<typename StaticVisitor> |
| 440 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( | 437 void StaticMarkingVisitor<StaticVisitor>::VisitSharedFunctionInfo( |
| 441 Map* map, HeapObject* object) { | 438 Map* map, HeapObject* object) { |
| 442 Heap* heap = map->GetHeap(); | 439 Heap* heap = map->GetHeap(); |
| 443 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); | 440 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); |
| 444 if (shared->ic_age() != heap->global_ic_age()) { | 441 if (shared->ic_age() != heap->global_ic_age()) { |
| 445 shared->ResetForNewContext(heap->global_ic_age()); | 442 shared->ResetForNewContext(heap->global_ic_age()); |
| 446 } | 443 } |
| 444 if (FLAG_cleanup_code_caches_at_gc) { |
| 445 shared->ClearTypeFeedbackInfo(heap); |
| 446 } |
| 447 if (FLAG_cache_optimized_code && | 447 if (FLAG_cache_optimized_code && |
| 448 FLAG_flush_optimized_code_cache && | 448 FLAG_flush_optimized_code_cache && |
| 449 !shared->optimized_code_map()->IsSmi()) { | 449 !shared->optimized_code_map()->IsSmi()) { |
| 450 // Always flush the optimized code map if requested by flag. | 450 // Always flush the optimized code map if requested by flag. |
| 451 shared->ClearOptimizedCodeMap(); | 451 shared->ClearOptimizedCodeMap(); |
| 452 } | 452 } |
| 453 MarkCompactCollector* collector = heap->mark_compact_collector(); | 453 MarkCompactCollector* collector = heap->mark_compact_collector(); |
| 454 if (collector->is_code_flushing_enabled()) { | 454 if (collector->is_code_flushing_enabled()) { |
| 455 if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) { | 455 if (FLAG_cache_optimized_code && !shared->optimized_code_map()->IsSmi()) { |
| 456 // Add the shared function info holding an optimized code map to | 456 // Add the shared function info holding an optimized code map to |
| (...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 940 RelocIterator it(this, mode_mask); | 940 RelocIterator it(this, mode_mask); |
| 941 for (; !it.done(); it.next()) { | 941 for (; !it.done(); it.next()) { |
| 942 it.rinfo()->template Visit<StaticVisitor>(heap); | 942 it.rinfo()->template Visit<StaticVisitor>(heap); |
| 943 } | 943 } |
| 944 } | 944 } |
| 945 | 945 |
| 946 | 946 |
| 947 } } // namespace v8::internal | 947 } } // namespace v8::internal |
| 948 | 948 |
| 949 #endif // V8_OBJECTS_VISITING_INL_H_ | 949 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |