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

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

Issue 2800923004: Revert of [heap] Remove size specializations in static object visitors. (Closed)
Patch Set: Created 3 years, 8 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
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | src/heap/scavenger.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OBJECTS_VISITING_INL_H_ 5 #ifndef V8_OBJECTS_VISITING_INL_H_
6 #define V8_OBJECTS_VISITING_INL_H_ 6 #define V8_OBJECTS_VISITING_INL_H_
7 7
8 #include "src/heap/array-buffer-tracker.h" 8 #include "src/heap/array-buffer-tracker.h"
9 #include "src/heap/mark-compact.h" 9 #include "src/heap/mark-compact.h"
10 #include "src/heap/objects-visiting.h" 10 #include "src/heap/objects-visiting.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 table_.Register(kVisitFreeSpace, &VisitFreeSpace); 89 table_.Register(kVisitFreeSpace, &VisitFreeSpace);
90 90
91 table_.Register( 91 table_.Register(
92 kVisitJSWeakCollection, 92 kVisitJSWeakCollection,
93 &FlexibleBodyVisitor<StaticVisitor, JSWeakCollection::BodyDescriptor, 93 &FlexibleBodyVisitor<StaticVisitor, JSWeakCollection::BodyDescriptor,
94 int>::Visit); 94 int>::Visit);
95 95
96 table_.Register(kVisitJSRegExp, &JSObjectVisitor::Visit); 96 table_.Register(kVisitJSRegExp, &JSObjectVisitor::Visit);
97 97
98 table_.Register(kVisitDataObject, &DataObjectVisitor::Visit); 98 table_.template RegisterSpecializations<DataObjectVisitor, kVisitDataObject,
99 kVisitDataObjectGeneric>();
99 100
100 table_.Register(kVisitJSObjectFast, &JSObjectFastVisitor::Visit); 101 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSObject,
101 table_.Register(kVisitJSObject, &JSObjectVisitor::Visit); 102 kVisitJSObjectGeneric>();
102 103
103 // Not using specialized Api object visitor for newspace. 104 // Not using specialized Api object visitor for newspace.
104 table_.Register(kVisitJSApiObject, &JSObjectVisitor::Visit); 105 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSApiObject,
106 kVisitJSApiObjectGeneric>();
105 107
106 table_.Register(kVisitStruct, &StructVisitor::Visit); 108 table_.template RegisterSpecializations<StructVisitor, kVisitStruct,
109 kVisitStructGeneric>();
107 110
108 table_.Register(kVisitBytecodeArray, &UnreachableVisitor); 111 table_.Register(kVisitBytecodeArray, &UnreachableVisitor);
109 table_.Register(kVisitSharedFunctionInfo, &UnreachableVisitor); 112 table_.Register(kVisitSharedFunctionInfo, &UnreachableVisitor);
110 } 113 }
111 114
112 template <typename StaticVisitor> 115 template <typename StaticVisitor>
113 void StaticMarkingVisitor<StaticVisitor>::Initialize() { 116 void StaticMarkingVisitor<StaticVisitor>::Initialize() {
114 table_.Register(kVisitShortcutCandidate, 117 table_.Register(kVisitShortcutCandidate,
115 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor, 118 &FixedBodyVisitor<StaticVisitor, ConsString::BodyDescriptor,
116 void>::Visit); 119 void>::Visit);
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 &FixedBodyVisitor<StaticVisitor, Cell::BodyDescriptor, void>::Visit); 191 &FixedBodyVisitor<StaticVisitor, Cell::BodyDescriptor, void>::Visit);
189 192
190 table_.Register(kVisitPropertyCell, 193 table_.Register(kVisitPropertyCell,
191 &FixedBodyVisitor<StaticVisitor, PropertyCell::BodyDescriptor, 194 &FixedBodyVisitor<StaticVisitor, PropertyCell::BodyDescriptor,
192 void>::Visit); 195 void>::Visit);
193 196
194 table_.Register(kVisitWeakCell, &VisitWeakCell); 197 table_.Register(kVisitWeakCell, &VisitWeakCell);
195 198
196 table_.Register(kVisitTransitionArray, &VisitTransitionArray); 199 table_.Register(kVisitTransitionArray, &VisitTransitionArray);
197 200
198 table_.Register(kVisitDataObject, &DataObjectVisitor::Visit); 201 table_.template RegisterSpecializations<DataObjectVisitor, kVisitDataObject,
202 kVisitDataObjectGeneric>();
199 203
200 table_.Register(kVisitJSObjectFast, &JSObjectFastVisitor::Visit); 204 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSObject,
201 table_.Register(kVisitJSObject, &JSObjectVisitor::Visit); 205 kVisitJSObjectGeneric>();
202 206
203 table_.Register(kVisitJSApiObject, &JSApiObjectVisitor::Visit); 207 table_.template RegisterSpecializations<JSApiObjectVisitor, kVisitJSApiObject,
208 kVisitJSApiObjectGeneric>();
204 209
205 table_.Register(kVisitStruct, &StructObjectVisitor::Visit); 210 table_.template RegisterSpecializations<StructObjectVisitor, kVisitStruct,
211 kVisitStructGeneric>();
206 } 212 }
207 213
208 214
209 template <typename StaticVisitor> 215 template <typename StaticVisitor>
210 void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry( 216 void StaticMarkingVisitor<StaticVisitor>::VisitCodeEntry(
211 Heap* heap, HeapObject* object, Address entry_address) { 217 Heap* heap, HeapObject* object, Address entry_address) {
212 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address)); 218 Code* code = Code::cast(Code::GetObjectFromEntryAddress(entry_address));
213 heap->mark_compact_collector()->RecordCodeEntrySlot(object, entry_address, 219 heap->mark_compact_collector()->RecordCodeEntrySlot(object, entry_address,
214 code); 220 code);
215 StaticVisitor::MarkObject(heap, code); 221 StaticVisitor::MarkObject(heap, code);
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, 639 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode,
634 void> JSFunctionWeakCodeBodyVisitor; 640 void> JSFunctionWeakCodeBodyVisitor;
635 JSFunctionWeakCodeBodyVisitor::Visit(map, object); 641 JSFunctionWeakCodeBodyVisitor::Visit(map, object);
636 } 642 }
637 643
638 644
639 } // namespace internal 645 } // namespace internal
640 } // namespace v8 646 } // namespace v8
641 647
642 #endif // V8_OBJECTS_VISITING_INL_H_ 648 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | src/heap/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698