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/objects-visiting-inl.h

Issue 10837037: Age code to allow reclaiming old unexecuted functions (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Cleanup code Created 8 years, 3 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
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 if (target != NULL) {
Michael Starzinger 2012/09/21 09:43:19 We should only reach this visit function if there
danno 2012/10/25 10:07:23 Done.
237 heap->mark_compact_collector()->RecordRelocSlot(rinfo, target);
238 StaticVisitor::MarkObject(heap, target);
239 }
240 }
241
242
243 template<typename StaticVisitor>
232 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext( 244 void StaticMarkingVisitor<StaticVisitor>::VisitNativeContext(
233 Map* map, HeapObject* object) { 245 Map* map, HeapObject* object) {
234 FixedBodyVisitor<StaticVisitor, 246 FixedBodyVisitor<StaticVisitor,
235 Context::MarkCompactBodyDescriptor, 247 Context::MarkCompactBodyDescriptor,
236 void>::Visit(map, object); 248 void>::Visit(map, object);
237 249
238 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector(); 250 MarkCompactCollector* collector = map->GetHeap()->mark_compact_collector();
239 for (int idx = Context::FIRST_WEAK_SLOT; 251 for (int idx = Context::FIRST_WEAK_SLOT;
240 idx < Context::NATIVE_CONTEXT_SLOTS; 252 idx < Context::NATIVE_CONTEXT_SLOTS;
241 ++idx) { 253 ++idx) {
242 Object** slot = 254 Object** slot =
243 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx)); 255 HeapObject::RawField(object, FixedArray::OffsetOfElementAt(idx));
244 collector->RecordSlot(slot, slot, *slot); 256 collector->RecordSlot(slot, slot, *slot);
245 } 257 }
246 } 258 }
247 259
248 260
249 template<typename StaticVisitor> 261 template<typename StaticVisitor>
250 void StaticMarkingVisitor<StaticVisitor>::VisitCode( 262 void StaticMarkingVisitor<StaticVisitor>::VisitCode(
251 Map* map, HeapObject* object) { 263 Map* map, HeapObject* object) {
252 Heap* heap = map->GetHeap(); 264 Heap* heap = map->GetHeap();
253 Code* code = Code::cast(object); 265 Code* code = Code::cast(object);
266 if (!Serializer::enabled()) {
267 code->MakeOlder();
Michael Starzinger 2012/09/21 09:43:19 We can pass heap->mark_compact_collector()->markin
danno 2012/10/25 10:07:23 Done.
268 }
254 if (FLAG_cleanup_code_caches_at_gc) { 269 if (FLAG_cleanup_code_caches_at_gc) {
255 code->ClearTypeFeedbackCells(heap); 270 code->ClearTypeFeedbackCells(heap);
256 } 271 }
257 code->CodeIterateBody<StaticVisitor>(heap); 272 code->CodeIterateBody<StaticVisitor>(heap);
258 } 273 }
259 274
260 275
261 template<typename StaticVisitor> 276 template<typename StaticVisitor>
262 void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp( 277 void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp(
263 Map* map, HeapObject* object) { 278 Map* map, HeapObject* object) {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 RelocIterator it(this, mode_mask); 335 RelocIterator it(this, mode_mask);
321 for (; !it.done(); it.next()) { 336 for (; !it.done(); it.next()) {
322 it.rinfo()->template Visit<StaticVisitor>(heap); 337 it.rinfo()->template Visit<StaticVisitor>(heap);
323 } 338 }
324 } 339 }
325 340
326 341
327 } } // namespace v8::internal 342 } } // namespace v8::internal
328 343
329 #endif // V8_OBJECTS_VISITING_INL_H_ 344 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« src/objects-visiting.h ('K') | « src/objects-visiting.h ('k') | src/serialize.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698