OLD | NEW |
1 // Copyright 2006-2008 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 |
11 // with the distribution. | 11 // with the distribution. |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
452 if (end - start >= kMinRangeForMarkingRecursion) { | 452 if (end - start >= kMinRangeForMarkingRecursion) { |
453 if (VisitUnmarkedObjects(heap, start, end)) return; | 453 if (VisitUnmarkedObjects(heap, start, end)) return; |
454 // We are close to a stack overflow, so just mark the objects. | 454 // We are close to a stack overflow, so just mark the objects. |
455 } | 455 } |
456 for (Object** p = start; p < end; p++) MarkObjectByPointer(heap, p); | 456 for (Object** p = start; p < end; p++) MarkObjectByPointer(heap, p); |
457 } | 457 } |
458 | 458 |
459 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { | 459 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { |
460 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); | 460 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); |
461 Code* code = Code::GetCodeFromTargetAddress(rinfo->target_address()); | 461 Code* code = Code::GetCodeFromTargetAddress(rinfo->target_address()); |
462 if (FLAG_cleanup_ics_at_gc && code->is_inline_cache_stub()) { | 462 if (FLAG_cleanup_code_caches_at_gc && code->is_inline_cache_stub()) { |
463 IC::Clear(rinfo->pc()); | 463 IC::Clear(rinfo->pc()); |
464 // Please note targets for cleared inline cached do not have to be | 464 // Please note targets for cleared inline cached do not have to be |
465 // marked since they are contained in HEAP->non_monomorphic_cache(). | 465 // marked since they are contained in HEAP->non_monomorphic_cache(). |
466 } else { | 466 } else { |
467 heap->mark_compact_collector()->MarkObject(code); | 467 heap->mark_compact_collector()->MarkObject(code); |
468 } | 468 } |
469 } | 469 } |
470 | 470 |
471 static void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo) { | 471 static void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo) { |
472 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); | 472 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1051 } | 1051 } |
1052 } | 1052 } |
1053 }; | 1053 }; |
1054 | 1054 |
1055 | 1055 |
1056 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) { | 1056 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) { |
1057 ASSERT(!object->IsMarked()); | 1057 ASSERT(!object->IsMarked()); |
1058 ASSERT(HEAP->Contains(object)); | 1058 ASSERT(HEAP->Contains(object)); |
1059 if (object->IsMap()) { | 1059 if (object->IsMap()) { |
1060 Map* map = Map::cast(object); | 1060 Map* map = Map::cast(object); |
1061 if (FLAG_cleanup_caches_in_maps_at_gc) { | 1061 if (FLAG_cleanup_code_caches_at_gc) { |
1062 map->ClearCodeCache(heap()); | 1062 map->ClearCodeCache(heap()); |
1063 } | 1063 } |
1064 SetMark(map); | 1064 SetMark(map); |
1065 if (FLAG_collect_maps && | 1065 if (FLAG_collect_maps && |
1066 map->instance_type() >= FIRST_JS_OBJECT_TYPE && | 1066 map->instance_type() >= FIRST_JS_OBJECT_TYPE && |
1067 map->instance_type() <= JS_FUNCTION_TYPE) { | 1067 map->instance_type() <= JS_FUNCTION_TYPE) { |
1068 MarkMapContents(map); | 1068 MarkMapContents(map); |
1069 } else { | 1069 } else { |
1070 marking_stack_.Push(map); | 1070 marking_stack_.Push(map); |
1071 } | 1071 } |
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3131 } | 3131 } |
3132 | 3132 |
3133 | 3133 |
3134 void MarkCompactCollector::Initialize() { | 3134 void MarkCompactCollector::Initialize() { |
3135 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 3135 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
3136 StaticMarkingVisitor::Initialize(); | 3136 StaticMarkingVisitor::Initialize(); |
3137 } | 3137 } |
3138 | 3138 |
3139 | 3139 |
3140 } } // namespace v8::internal | 3140 } } // namespace v8::internal |
OLD | NEW |