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

Side by Side Diff: src/objects-visiting-inl.h

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/objects-visiting.h ('k') | no next file » | 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 template<typename StaticVisitor> 169 template<typename StaticVisitor>
170 void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry( 170 void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry(
171 Heap* heap, Address entry_address) { 171 Heap* heap, Address entry_address) {
172 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); 172 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
173 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code); 173 heap->mark_compact_collector()->RecordCodeEntrySlot(entry_address, code);
174 StaticVisitor::MarkObject(heap, code); 174 StaticVisitor::MarkObject(heap, code);
175 } 175 }
176 176
177 177
178 template<typename StaticVisitor> 178 template<typename StaticVisitor>
179 void StaticMarkingVisitor<StaticVisitor>::VisitEmbeddedPointer(
180 Heap* heap, RelocInfo* rinfo) {
181 ASSERT(rinfo->rmode() == RelocInfo::EMBEDDED_OBJECT);
182 ASSERT(!rinfo->target_object()->IsConsString());
183 HeapObject* object = HeapObject::cast(rinfo->target_object());
184 heap->mark_compact_collector()->RecordRelocSlot(rinfo, object);
185 StaticVisitor::MarkObject(heap, object);
186 }
187
188
189 template<typename StaticVisitor>
179 void StaticMarkingVisitor<StaticVisitor>::VisitGlobalPropertyCell( 190 void StaticMarkingVisitor<StaticVisitor>::VisitGlobalPropertyCell(
180 Heap* heap, RelocInfo* rinfo) { 191 Heap* heap, RelocInfo* rinfo) {
181 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL); 192 ASSERT(rinfo->rmode() == RelocInfo::GLOBAL_PROPERTY_CELL);
182 JSGlobalPropertyCell* cell = rinfo->target_cell(); 193 JSGlobalPropertyCell* cell = rinfo->target_cell();
183 StaticVisitor::MarkObject(heap, cell); 194 StaticVisitor::MarkObject(heap, cell);
184 } 195 }
185 196
186 197
187 template<typename StaticVisitor> 198 template<typename StaticVisitor>
188 void StaticMarkingVisitor<StaticVisitor>::VisitDebugTarget( 199 void StaticMarkingVisitor<StaticVisitor>::VisitDebugTarget(
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 RelocIterator it(this, mode_mask); 288 RelocIterator it(this, mode_mask);
278 for (; !it.done(); it.next()) { 289 for (; !it.done(); it.next()) {
279 it.rinfo()->template Visit<StaticVisitor>(heap); 290 it.rinfo()->template Visit<StaticVisitor>(heap);
280 } 291 }
281 } 292 }
282 293
283 294
284 } } // namespace v8::internal 295 } } // namespace v8::internal
285 296
286 #endif // V8_OBJECTS_VISITING_INL_H_ 297 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-visiting.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698