Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: src/mark-compact.cc

Issue 7036016: Reland 7917: (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixes to make re-land work Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/log.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 if (end - start >= kMinRangeForMarkingRecursion) { 450 if (end - start >= kMinRangeForMarkingRecursion) {
451 if (VisitUnmarkedObjects(heap, start, end)) return; 451 if (VisitUnmarkedObjects(heap, start, end)) return;
452 // We are close to a stack overflow, so just mark the objects. 452 // We are close to a stack overflow, so just mark the objects.
453 } 453 }
454 for (Object** p = start; p < end; p++) MarkObjectByPointer(heap, p); 454 for (Object** p = start; p < end; p++) MarkObjectByPointer(heap, p);
455 } 455 }
456 456
457 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { 457 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) {
458 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); 458 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
459 Code* code = Code::GetCodeFromTargetAddress(rinfo->target_address()); 459 Code* code = Code::GetCodeFromTargetAddress(rinfo->target_address());
460 if (FLAG_cleanup_ics_at_gc && code->is_inline_cache_stub()) { 460 if (FLAG_cleanup_code_caches_at_gc && code->is_inline_cache_stub()) {
461 IC::Clear(rinfo->pc()); 461 IC::Clear(rinfo->pc());
462 // Please note targets for cleared inline cached do not have to be 462 // Please note targets for cleared inline cached do not have to be
463 // marked since they are contained in HEAP->non_monomorphic_cache(). 463 // marked since they are contained in HEAP->non_monomorphic_cache().
464 } else { 464 } else {
465 heap->mark_compact_collector()->MarkObject(code); 465 heap->mark_compact_collector()->MarkObject(code);
466 } 466 }
467 } 467 }
468 468
469 static void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo) { 469 static void VisitGlobalPropertyCell(Heap* heap, RelocInfo* rinfo) {
470 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); 470 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL);
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
1049 } 1049 }
1050 } 1050 }
1051 }; 1051 };
1052 1052
1053 1053
1054 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) { 1054 void MarkCompactCollector::MarkUnmarkedObject(HeapObject* object) {
1055 ASSERT(!object->IsMarked()); 1055 ASSERT(!object->IsMarked());
1056 ASSERT(HEAP->Contains(object)); 1056 ASSERT(HEAP->Contains(object));
1057 if (object->IsMap()) { 1057 if (object->IsMap()) {
1058 Map* map = Map::cast(object); 1058 Map* map = Map::cast(object);
1059 if (FLAG_cleanup_caches_in_maps_at_gc) { 1059 if (FLAG_cleanup_code_caches_at_gc) {
1060 map->ClearCodeCache(heap()); 1060 map->ClearCodeCache(heap());
1061 } 1061 }
1062 SetMark(map); 1062 SetMark(map);
1063 if (FLAG_collect_maps && 1063 if (FLAG_collect_maps &&
1064 map->instance_type() >= FIRST_JS_OBJECT_TYPE && 1064 map->instance_type() >= FIRST_JS_OBJECT_TYPE &&
1065 map->instance_type() <= JS_FUNCTION_TYPE) { 1065 map->instance_type() <= JS_FUNCTION_TYPE) {
1066 MarkMapContents(map); 1066 MarkMapContents(map);
1067 } else { 1067 } else {
1068 marking_stack_.Push(map); 1068 marking_stack_.Push(map);
1069 } 1069 }
(...skipping 2059 matching lines...) Expand 10 before | Expand all | Expand 10 after
3129 } 3129 }
3130 3130
3131 3131
3132 void MarkCompactCollector::Initialize() { 3132 void MarkCompactCollector::Initialize() {
3133 StaticPointersToNewGenUpdatingVisitor::Initialize(); 3133 StaticPointersToNewGenUpdatingVisitor::Initialize();
3134 StaticMarkingVisitor::Initialize(); 3134 StaticMarkingVisitor::Initialize();
3135 } 3135 }
3136 3136
3137 3137
3138 } } // namespace v8::internal 3138 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/log.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698