OLD | NEW |
---|---|
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
837 } | 837 } |
838 | 838 |
839 | 839 |
840 void Heap::MarkCompactPrologue(bool is_compacting) { | 840 void Heap::MarkCompactPrologue(bool is_compacting) { |
841 // At any old GC clear the keyed lookup cache to enable collection of unused | 841 // At any old GC clear the keyed lookup cache to enable collection of unused |
842 // maps. | 842 // maps. |
843 KeyedLookupCache::Clear(); | 843 KeyedLookupCache::Clear(); |
844 ContextSlotCache::Clear(); | 844 ContextSlotCache::Clear(); |
845 DescriptorLookupCache::Clear(); | 845 DescriptorLookupCache::Clear(); |
846 | 846 |
847 RuntimeProfiler::MarkCompactPrologue(is_compacting); | |
848 | |
849 CompilationCache::MarkCompactPrologue(); | 847 CompilationCache::MarkCompactPrologue(); |
850 | 848 |
851 CompletelyClearInstanceofCache(); | 849 CompletelyClearInstanceofCache(); |
852 | 850 |
853 if (is_compacting) FlushNumberStringCache(); | 851 if (is_compacting) FlushNumberStringCache(); |
854 | 852 |
855 ClearNormalizedMapCaches(); | 853 ClearNormalizedMapCaches(); |
856 } | 854 } |
857 | 855 |
858 | 856 |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1049 Address value_address = | 1047 Address value_address = |
1050 reinterpret_cast<Address>(cell) + | 1048 reinterpret_cast<Address>(cell) + |
1051 (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag); | 1049 (JSGlobalPropertyCell::kValueOffset - kHeapObjectTag); |
1052 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); | 1050 scavenge_visitor.VisitPointer(reinterpret_cast<Object**>(value_address)); |
1053 } | 1051 } |
1054 } | 1052 } |
1055 | 1053 |
1056 // Scavenge object reachable from the global contexts list directly. | 1054 // Scavenge object reachable from the global contexts list directly. |
1057 scavenge_visitor.VisitPointer(BitCast<Object**>(&global_contexts_list_)); | 1055 scavenge_visitor.VisitPointer(BitCast<Object**>(&global_contexts_list_)); |
1058 | 1056 |
1059 // Scavenge objects reachable from the runtime-profiler sampler | |
1060 // window directly. | |
1061 Object** sampler_window_address = RuntimeProfiler::SamplerWindowAddress(); | |
1062 int sampler_window_size = RuntimeProfiler::SamplerWindowSize(); | |
1063 scavenge_visitor.VisitPointers( | |
1064 sampler_window_address, | |
1065 sampler_window_address + sampler_window_size); | |
1066 | |
1067 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); | 1057 new_space_front = DoScavenge(&scavenge_visitor, new_space_front); |
1068 | 1058 |
1069 UpdateNewSpaceReferencesInExternalStringTable( | 1059 UpdateNewSpaceReferencesInExternalStringTable( |
1070 &UpdateNewSpaceReferenceInExternalStringTableEntry); | 1060 &UpdateNewSpaceReferenceInExternalStringTableEntry); |
1071 | 1061 |
1072 LiveObjectList::UpdateReferencesForScavengeGC(); | 1062 LiveObjectList::UpdateReferencesForScavengeGC(); |
1073 | 1063 |
1074 ASSERT(new_space_front == new_space_.top()); | 1064 ASSERT(new_space_front == new_space_.top()); |
1075 | 1065 |
1076 // Set age mark. | 1066 // Set age mark. |
1077 new_space_.set_age_mark(new_space_.top()); | 1067 new_space_.set_age_mark(new_space_.top()); |
1078 | 1068 |
1079 // Update how much has survived scavenge. | 1069 // Update how much has survived scavenge. |
1080 IncrementYoungSurvivorsCounter(static_cast<int>( | 1070 IncrementYoungSurvivorsCounter(static_cast<int>( |
1081 (PromotedSpaceSize() - survived_watermark) + new_space_.Size())); | 1071 (PromotedSpaceSize() - survived_watermark) + new_space_.Size())); |
1082 | 1072 |
Vyacheslav Egorov (Chromium)
2011/03/01 17:18:44
You can move it up and place it near LiveObjectLis
| |
1073 // Update JSFunction pointers from the runtime profiler. | |
1074 RuntimeProfiler::UpdateSamplesAfterScavenge(); | |
1075 | |
1083 LOG(ResourceEvent("scavenge", "end")); | 1076 LOG(ResourceEvent("scavenge", "end")); |
1084 | 1077 |
1085 gc_state_ = NOT_IN_GC; | 1078 gc_state_ = NOT_IN_GC; |
1086 } | 1079 } |
1087 | 1080 |
1088 | 1081 |
1089 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Object** p) { | 1082 String* Heap::UpdateNewSpaceReferenceInExternalStringTableEntry(Object** p) { |
1090 MapWord first_word = HeapObject::cast(*p)->map_word(); | 1083 MapWord first_word = HeapObject::cast(*p)->map_word(); |
1091 | 1084 |
1092 if (!first_word.IsForwardingAddress()) { | 1085 if (!first_word.IsForwardingAddress()) { |
(...skipping 4513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5606 void ExternalStringTable::TearDown() { | 5599 void ExternalStringTable::TearDown() { |
5607 new_space_strings_.Free(); | 5600 new_space_strings_.Free(); |
5608 old_space_strings_.Free(); | 5601 old_space_strings_.Free(); |
5609 } | 5602 } |
5610 | 5603 |
5611 | 5604 |
5612 List<Object*> ExternalStringTable::new_space_strings_; | 5605 List<Object*> ExternalStringTable::new_space_strings_; |
5613 List<Object*> ExternalStringTable::old_space_strings_; | 5606 List<Object*> ExternalStringTable::old_space_strings_; |
5614 | 5607 |
5615 } } // namespace v8::internal | 5608 } } // namespace v8::internal |
OLD | NEW |