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

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

Issue 17895004: Add DependentCode to PropertyCells (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Moar review feedback Created 7 years, 6 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') | src/x64/lithium-codegen-x64.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 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 table_.Register(kVisitJSDataView, &VisitJSDataView); 215 table_.Register(kVisitJSDataView, &VisitJSDataView);
216 216
217 // Registration for kVisitJSRegExp is done by StaticVisitor. 217 // Registration for kVisitJSRegExp is done by StaticVisitor.
218 218
219 table_.Register(kVisitCell, 219 table_.Register(kVisitCell,
220 &FixedBodyVisitor<StaticVisitor, 220 &FixedBodyVisitor<StaticVisitor,
221 Cell::BodyDescriptor, 221 Cell::BodyDescriptor,
222 void>::Visit); 222 void>::Visit);
223 223
224 table_.Register(kVisitPropertyCell, 224 table_.Register(kVisitPropertyCell, &VisitPropertyCell);
225 &FixedBodyVisitor<StaticVisitor,
226 PropertyCell::BodyDescriptor,
227 void>::Visit);
228 225
229 table_.template RegisterSpecializations<DataObjectVisitor, 226 table_.template RegisterSpecializations<DataObjectVisitor,
230 kVisitDataObject, 227 kVisitDataObject,
231 kVisitDataObjectGeneric>(); 228 kVisitDataObjectGeneric>();
232 229
233 table_.template RegisterSpecializations<JSObjectVisitor, 230 table_.template RegisterSpecializations<JSObjectVisitor,
234 kVisitJSObject, 231 kVisitJSObject,
235 kVisitJSObjectGeneric>(); 232 kVisitJSObjectGeneric>();
236 233
237 table_.template RegisterSpecializations<StructObjectVisitor, 234 table_.template RegisterSpecializations<StructObjectVisitor,
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 MarkMapContents(heap, map_object); 349 MarkMapContents(heap, map_object);
353 } else { 350 } else {
354 StaticVisitor::VisitPointers(heap, 351 StaticVisitor::VisitPointers(heap,
355 HeapObject::RawField(object, Map::kPointerFieldsBeginOffset), 352 HeapObject::RawField(object, Map::kPointerFieldsBeginOffset),
356 HeapObject::RawField(object, Map::kPointerFieldsEndOffset)); 353 HeapObject::RawField(object, Map::kPointerFieldsEndOffset));
357 } 354 }
358 } 355 }
359 356
360 357
361 template<typename StaticVisitor> 358 template<typename StaticVisitor>
359 void StaticMarkingVisitor<StaticVisitor>::VisitPropertyCell(
360 Map* map, HeapObject* object) {
361 Heap* heap = map->GetHeap();
362
363 Object** slot =
364 HeapObject::RawField(object, PropertyCell::kDependentCodeOffset);
365 if (FLAG_collect_maps) {
366 // Mark property cell dependent codes array but do not push it onto marking
367 // stack, this will make references from it weak. We will clean dead
368 // codes when we iterate over property cells in ClearNonLiveReferences.
369 HeapObject* obj = HeapObject::cast(*slot);
370 heap->mark_compact_collector()->RecordSlot(slot, slot, obj);
371 StaticVisitor::MarkObjectWithoutPush(heap, obj);
372 } else {
373 StaticVisitor::VisitPointer(heap, slot);
374 }
375
376 StaticVisitor::VisitPointers(heap,
377 HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset),
378 HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset));
379 }
380
381
382 template<typename StaticVisitor>
362 void StaticMarkingVisitor<StaticVisitor>::VisitCode( 383 void StaticMarkingVisitor<StaticVisitor>::VisitCode(
363 Map* map, HeapObject* object) { 384 Map* map, HeapObject* object) {
364 Heap* heap = map->GetHeap(); 385 Heap* heap = map->GetHeap();
365 Code* code = Code::cast(object); 386 Code* code = Code::cast(object);
366 if (FLAG_cleanup_code_caches_at_gc) { 387 if (FLAG_cleanup_code_caches_at_gc) {
367 code->ClearTypeFeedbackCells(heap); 388 code->ClearTypeFeedbackCells(heap);
368 } 389 }
369 if (FLAG_age_code && !Serializer::enabled()) { 390 if (FLAG_age_code && !Serializer::enabled()) {
370 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); 391 code->MakeOlder(heap->mark_compact_collector()->marking_parity());
371 } 392 }
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 RelocIterator it(this, mode_mask); 873 RelocIterator it(this, mode_mask);
853 for (; !it.done(); it.next()) { 874 for (; !it.done(); it.next()) {
854 it.rinfo()->template Visit<StaticVisitor>(heap); 875 it.rinfo()->template Visit<StaticVisitor>(heap);
855 } 876 }
856 } 877 }
857 878
858 879
859 } } // namespace v8::internal 880 } } // namespace v8::internal
860 881
861 #endif // V8_OBJECTS_VISITING_INL_H_ 882 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-visiting.h ('k') | src/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698