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

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

Issue 62803008: Bugfix: make dependent code field in AllocationSite weak. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fixed nit. Created 7 years, 1 month 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') | test/mjsunit/regress/regress-320532.js » ('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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void>::Visit); 182 void>::Visit);
183 183
184 table_.Register(kVisitFixedArray, &FixedArrayVisitor::Visit); 184 table_.Register(kVisitFixedArray, &FixedArrayVisitor::Visit);
185 185
186 table_.Register(kVisitFixedDoubleArray, &DataObjectVisitor::Visit); 186 table_.Register(kVisitFixedDoubleArray, &DataObjectVisitor::Visit);
187 187
188 table_.Register(kVisitConstantPoolArray, &VisitConstantPoolArray); 188 table_.Register(kVisitConstantPoolArray, &VisitConstantPoolArray);
189 189
190 table_.Register(kVisitNativeContext, &VisitNativeContext); 190 table_.Register(kVisitNativeContext, &VisitNativeContext);
191 191
192 table_.Register(kVisitAllocationSite, 192 table_.Register(kVisitAllocationSite, &VisitAllocationSite);
193 &FixedBodyVisitor<StaticVisitor,
194 AllocationSite::BodyDescriptor,
195 void>::Visit);
196 193
197 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit); 194 table_.Register(kVisitByteArray, &DataObjectVisitor::Visit);
198 195
199 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit); 196 table_.Register(kVisitFreeSpace, &DataObjectVisitor::Visit);
200 197
201 table_.Register(kVisitSeqOneByteString, &DataObjectVisitor::Visit); 198 table_.Register(kVisitSeqOneByteString, &DataObjectVisitor::Visit);
202 199
203 table_.Register(kVisitSeqTwoByteString, &DataObjectVisitor::Visit); 200 table_.Register(kVisitSeqTwoByteString, &DataObjectVisitor::Visit);
204 201
205 table_.Register(kVisitJSWeakMap, &StaticVisitor::VisitWeakCollection); 202 table_.Register(kVisitJSWeakMap, &StaticVisitor::VisitWeakCollection);
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 StaticVisitor::VisitPointer(heap, slot); 379 StaticVisitor::VisitPointer(heap, slot);
383 } 380 }
384 381
385 StaticVisitor::VisitPointers(heap, 382 StaticVisitor::VisitPointers(heap,
386 HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset), 383 HeapObject::RawField(object, PropertyCell::kPointerFieldsBeginOffset),
387 HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset)); 384 HeapObject::RawField(object, PropertyCell::kPointerFieldsEndOffset));
388 } 385 }
389 386
390 387
391 template<typename StaticVisitor> 388 template<typename StaticVisitor>
389 void StaticMarkingVisitor<StaticVisitor>::VisitAllocationSite(
390 Map* map, HeapObject* object) {
391 Heap* heap = map->GetHeap();
392
393 Object** slot =
394 HeapObject::RawField(object, AllocationSite::kDependentCodeOffset);
395 if (FLAG_collect_maps) {
396 // Mark allocation site dependent codes array but do not push it onto
397 // marking stack, this will make references from it weak. We will clean
398 // dead codes when we iterate over allocation sites in
399 // ClearNonLiveReferences.
400 HeapObject* obj = HeapObject::cast(*slot);
401 heap->mark_compact_collector()->RecordSlot(slot, slot, obj);
402 StaticVisitor::MarkObjectWithoutPush(heap, obj);
403 } else {
404 StaticVisitor::VisitPointer(heap, slot);
405 }
406
407 StaticVisitor::VisitPointers(heap,
408 HeapObject::RawField(object, AllocationSite::kPointerFieldsBeginOffset),
409 HeapObject::RawField(object, AllocationSite::kPointerFieldsEndOffset));
410 }
411
412
413 template<typename StaticVisitor>
392 void StaticMarkingVisitor<StaticVisitor>::VisitCode( 414 void StaticMarkingVisitor<StaticVisitor>::VisitCode(
393 Map* map, HeapObject* object) { 415 Map* map, HeapObject* object) {
394 Heap* heap = map->GetHeap(); 416 Heap* heap = map->GetHeap();
395 Code* code = Code::cast(object); 417 Code* code = Code::cast(object);
396 if (FLAG_cleanup_code_caches_at_gc) { 418 if (FLAG_cleanup_code_caches_at_gc) {
397 code->ClearTypeFeedbackCells(heap); 419 code->ClearTypeFeedbackCells(heap);
398 } 420 }
399 if (FLAG_age_code && !Serializer::enabled()) { 421 if (FLAG_age_code && !Serializer::enabled()) {
400 code->MakeOlder(heap->mark_compact_collector()->marking_parity()); 422 code->MakeOlder(heap->mark_compact_collector()->marking_parity());
401 } 423 }
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after
899 RelocIterator it(this, mode_mask); 921 RelocIterator it(this, mode_mask);
900 for (; !it.done(); it.next()) { 922 for (; !it.done(); it.next()) {
901 it.rinfo()->template Visit<StaticVisitor>(heap); 923 it.rinfo()->template Visit<StaticVisitor>(heap);
902 } 924 }
903 } 925 }
904 926
905 927
906 } } // namespace v8::internal 928 } } // namespace v8::internal
907 929
908 #endif // V8_OBJECTS_VISITING_INL_H_ 930 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/objects-visiting.h ('k') | test/mjsunit/regress/regress-320532.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698