| 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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 static void Initialize() { | 168 static void Initialize() { |
| 169 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); | 169 StaticMarkingVisitor<IncrementalMarkingMarkingVisitor>::Initialize(); |
| 170 | 170 |
| 171 table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo); | 171 table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo); |
| 172 | 172 |
| 173 table_.Register(kVisitJSFunction, &VisitJSFunction); | 173 table_.Register(kVisitJSFunction, &VisitJSFunction); |
| 174 | 174 |
| 175 table_.Register(kVisitJSRegExp, &VisitJSRegExp); | 175 table_.Register(kVisitJSRegExp, &VisitJSRegExp); |
| 176 } | 176 } |
| 177 | 177 |
| 178 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | |
| 179 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | |
| 180 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | |
| 181 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() | |
| 182 && (target->ic_age() != heap->global_ic_age())) { | |
| 183 IC::Clear(rinfo->pc()); | |
| 184 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | |
| 185 } | |
| 186 heap->mark_compact_collector()->RecordRelocSlot(rinfo, Code::cast(target)); | |
| 187 MarkObject(heap, target); | |
| 188 } | |
| 189 | |
| 190 static void VisitJSWeakMap(Map* map, HeapObject* object) { | 178 static void VisitJSWeakMap(Map* map, HeapObject* object) { |
| 191 Heap* heap = map->GetHeap(); | 179 Heap* heap = map->GetHeap(); |
| 192 VisitPointers(heap, | 180 VisitPointers(heap, |
| 193 HeapObject::RawField(object, JSWeakMap::kPropertiesOffset), | 181 HeapObject::RawField(object, JSWeakMap::kPropertiesOffset), |
| 194 HeapObject::RawField(object, JSWeakMap::kSize)); | 182 HeapObject::RawField(object, JSWeakMap::kSize)); |
| 195 } | 183 } |
| 196 | 184 |
| 197 static void VisitSharedFunctionInfo(Map* map, HeapObject* object) { | 185 static void VisitSharedFunctionInfo(Map* map, HeapObject* object) { |
| 198 Heap* heap = map->GetHeap(); | 186 Heap* heap = map->GetHeap(); |
| 199 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); | 187 SharedFunctionInfo* shared = SharedFunctionInfo::cast(object); |
| (...skipping 756 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 956 allocation_marking_factor_ = kInitialAllocationMarkingFactor; | 944 allocation_marking_factor_ = kInitialAllocationMarkingFactor; |
| 957 bytes_scanned_ = 0; | 945 bytes_scanned_ = 0; |
| 958 } | 946 } |
| 959 | 947 |
| 960 | 948 |
| 961 int64_t IncrementalMarking::SpaceLeftInOldSpace() { | 949 int64_t IncrementalMarking::SpaceLeftInOldSpace() { |
| 962 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); | 950 return heap_->MaxOldGenerationSize() - heap_->PromotedSpaceSizeOfObjects(); |
| 963 } | 951 } |
| 964 | 952 |
| 965 } } // namespace v8::internal | 953 } } // namespace v8::internal |
| OLD | NEW |