OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 670 |
671 if (FLAG_cleanup_code_caches_at_gc) { | 671 if (FLAG_cleanup_code_caches_at_gc) { |
672 PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache(); | 672 PolymorphicCodeCache* poly_cache = heap_->polymorphic_code_cache(); |
673 Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache)); | 673 Marking::GreyToBlack(Marking::MarkBitFrom(poly_cache)); |
674 MemoryChunk::IncrementLiveBytes(poly_cache->address(), | 674 MemoryChunk::IncrementLiveBytes(poly_cache->address(), |
675 PolymorphicCodeCache::kSize); | 675 PolymorphicCodeCache::kSize); |
676 } | 676 } |
677 | 677 |
678 Object* context = heap_->global_contexts_list(); | 678 Object* context = heap_->global_contexts_list(); |
679 while (!context->IsUndefined()) { | 679 while (!context->IsUndefined()) { |
680 NormalizedMapCache* cache = Context::cast(context)->normalized_map_cache(); | 680 // GC can happen when the context is not fully initialized, |
681 MarkBit mark_bit = Marking::MarkBitFrom(cache); | 681 // so the cache can be undefined. |
682 if (Marking::IsGrey(mark_bit)) { | 682 HeapObject* cache = HeapObject::cast( |
683 Marking::GreyToBlack(mark_bit); | 683 Context::cast(context)->get(Context::NORMALIZED_MAP_CACHE_INDEX)); |
684 MemoryChunk::IncrementLiveBytes(cache->address(), cache->Size()); | 684 if (!cache->IsUndefined()) { |
| 685 MarkBit mark_bit = Marking::MarkBitFrom(cache); |
| 686 if (Marking::IsGrey(mark_bit)) { |
| 687 Marking::GreyToBlack(mark_bit); |
| 688 MemoryChunk::IncrementLiveBytes(cache->address(), cache->Size()); |
| 689 } |
685 } | 690 } |
686 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); | 691 context = Context::cast(context)->get(Context::NEXT_CONTEXT_LINK); |
687 } | 692 } |
688 } | 693 } |
689 | 694 |
690 | 695 |
691 void IncrementalMarking::Abort() { | 696 void IncrementalMarking::Abort() { |
692 if (IsStopped()) return; | 697 if (IsStopped()) return; |
693 if (FLAG_trace_incremental_marking) { | 698 if (FLAG_trace_incremental_marking) { |
694 PrintF("[IncrementalMarking] Aborting.\n"); | 699 PrintF("[IncrementalMarking] Aborting.\n"); |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 916 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
912 bytes_scanned_ = 0; | 917 bytes_scanned_ = 0; |
913 } | 918 } |
914 | 919 |
915 | 920 |
916 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 921 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
917 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); | 922 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSize(); |
918 } | 923 } |
919 | 924 |
920 } } // namespace v8::internal | 925 } } // namespace v8::internal |
OLD | NEW |