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

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

Issue 10826079: Refactor marking to share embedded pointer visitor. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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/incremental-marking.cc ('k') | src/objects-visiting.h » ('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 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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 for (Object** p = start; p < end; p++) { 1071 for (Object** p = start; p < end; p++) {
1072 MarkObjectByPointer(collector, start, p); 1072 MarkObjectByPointer(collector, start, p);
1073 } 1073 }
1074 } 1074 }
1075 1075
1076 INLINE(static void MarkObject(Heap* heap, HeapObject* object)) { 1076 INLINE(static void MarkObject(Heap* heap, HeapObject* object)) {
1077 MarkBit mark = Marking::MarkBitFrom(object); 1077 MarkBit mark = Marking::MarkBitFrom(object);
1078 heap->mark_compact_collector()->MarkObject(object, mark); 1078 heap->mark_compact_collector()->MarkObject(object, mark);
1079 } 1079 }
1080 1080
1081 static inline void VisitEmbeddedPointer(Heap* heap, RelocInfo* rinfo) {
1082 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
1083 // TODO(mstarzinger): We do not short-circuit cons strings here, verify
1084 // that there can be no such embedded pointers and add assertion here.
1085 HeapObject* object = HeapObject::cast(rinfo->target_object());
1086 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
1087 MarkObject(heap, object);
1088 }
1089
1090 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) { 1081 static inline void VisitCodeTarget(Heap* heap, RelocInfo* rinfo) {
1091 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode())); 1082 ASSERT(RelocInfo::IsCodeTarget(rinfo->rmode()));
1092 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address()); 1083 Code* target = Code::GetCodeFromTargetAddress(rinfo->target_address());
1093 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub() 1084 if (FLAG_cleanup_code_caches_at_gc && target->is_inline_cache_stub()
1094 && (target->ic_state() == MEGAMORPHIC || 1085 && (target->ic_state() == MEGAMORPHIC ||
1095 heap->mark_compact_collector()->flush_monomorphic_ics_ || 1086 heap->mark_compact_collector()->flush_monomorphic_ics_ ||
1096 target->ic_age() != heap->global_ic_age())) { 1087 target->ic_age() != heap->global_ic_age())) {
1097 IC::Clear(rinfo->pc()); 1088 IC::Clear(rinfo->pc());
1098 target = Code::GetCodeFromTargetAddress(rinfo->target_address()); 1089 target = Code::GetCodeFromTargetAddress(rinfo->target_address());
1099 } 1090 }
(...skipping 3148 matching lines...) Expand 10 before | Expand all | Expand 10 after
4248 while (buffer != NULL) { 4239 while (buffer != NULL) {
4249 SlotsBuffer* next_buffer = buffer->next(); 4240 SlotsBuffer* next_buffer = buffer->next();
4250 DeallocateBuffer(buffer); 4241 DeallocateBuffer(buffer);
4251 buffer = next_buffer; 4242 buffer = next_buffer;
4252 } 4243 }
4253 *buffer_address = NULL; 4244 *buffer_address = NULL;
4254 } 4245 }
4255 4246
4256 4247
4257 } } // namespace v8::internal 4248 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/incremental-marking.cc ('k') | src/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698