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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 target->ic_age() != heap->global_ic_age())) { | 222 target->ic_age() != heap->global_ic_age())) { |
223 IC::Clear(rinfo->pc()); | 223 IC::Clear(rinfo->pc()); |
224 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 224 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
225 } | 225 } |
226 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); | 226 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
227 StaticVisitor::MarkObject(heap, target); | 227 StaticVisitor::MarkObject(heap, target); |
228 } | 228 } |
229 | 229 |
230 | 230 |
231 template<typename StaticVisitor> | 231 template<typename StaticVisitor> |
| 232 void StaticMarkingVisitor<StaticVisitor>::VisitCodeAgeSequence( |
| 233 Heap* heap, RelocInfo* rinfo) { |
| 234 ASSERT(RelocInfo::IsCodeAgeSequence(rinfo->rmode())); |
| 235 Code* target = rinfo->code_age_stub(); |
| 236 ASSERT(target != NULL); |
| 237 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target); |
| 238 StaticVisitor::MarkObject(heap, target); |
| 239 } |
| 240 |
| 241 |
| 242 template<typename StaticVisitor> |
232 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( | 243 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( |
233 Map* map, HeapObject* object) { | 244 Map* map, HeapObject* object) { |
234 FixedBodyVisitor<StaticVisitor, | 245 FixedBodyVisitor<StaticVisitor, |
235 Context::MarkCompactBodyDescriptor, | 246 Context::MarkCompactBodyDescriptor, |
236 void>::Visit(map, object); | 247 void>::Visit(map, object); |
237 | 248 |
238 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector(); | 249 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector(); |
239 for (int idx = Context::FIRST_WEAK_SLOT; | 250 for (int idx = Context::FIRST_WEAK_SLOT; |
240 idx < Context::NATIVE_CONTEXT_SLOTS; | 251 idx < Context::NATIVE_CONTEXT_SLOTS; |
241 ++idx) { | 252 ++idx) { |
242 Object** slot = | 253 Object** slot = |
243 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx)); | 254 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx)); |
244 collector->RecordSlot(slot, slot, *slot); | 255 collector->RecordSlot(slot, slot, *slot); |
245 } | 256 } |
246 } | 257 } |
247 | 258 |
248 | 259 |
249 template<typename StaticVisitor> | 260 template<typename StaticVisitor> |
250 void StaticMarkingVisitor<StaticVisitor>::VisitCode( | 261 void StaticMarkingVisitor<StaticVisitor>::VisitCode( |
251 Map* map, HeapObject* object) { | 262 Map* map, HeapObject* object) { |
252 Heap* heap = map->GetHeap(); | 263 Heap* heap = map->GetHeap(); |
253 Code* code = Code::cast(object); | 264 Code* code = Code::cast(object); |
| 265 if (!Serializer::enabled()) { |
| 266 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); |
| 267 } |
254 if (FLAG_cleanup_code_caches_at_gc) { | 268 if (FLAG_cleanup_code_caches_at_gc) { |
255 code->ClearTypeFeedbackCells(heap); | 269 code->ClearTypeFeedbackCells(heap); |
256 } | 270 } |
257 code->CodeIterateBody<StaticVisitor>(heap); | 271 code->CodeIterateBody<StaticVisitor>(heap); |
258 } | 272 } |
259 | 273 |
260 | 274 |
261 template<typename StaticVisitor> | 275 template<typename StaticVisitor> |
262 void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp( | 276 void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp( |
263 Map* map, HeapObject* object) { | 277 Map* map, HeapObject* object) { |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 RelocIterator it(this, mode_mask); | 334 RelocIterator it(this, mode_mask); |
321 for (; !it.done(); it.next()) { | 335 for (; !it.done(); it.next()) { |
322 it.rinfo()->template Visit<StaticVisitor>(heap); | 336 it.rinfo()->template Visit<StaticVisitor>(heap); |
323 } | 337 } |
324 } | 338 } |
325 | 339 |
326 | 340 |
327 } } // namespace v8::internal | 341 } } // namespace v8::internal |
328 | 342 |
329 #endif // V8_OBJECTS_VISITING_INL_H_ | 343 #endif // V8_OBJECTS_VISITING_INL_H_ |
OLD | NEW |