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

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

Issue 17153011: DataView implementation. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Self-review 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
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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 table_.Register(kVisitSeqOneByteString, &VisitSeqOneByteString); 76 table_.Register(kVisitSeqOneByteString, &VisitSeqOneByteString);
77 77
78 table_.Register(kVisitSeqTwoByteString, &VisitSeqTwoByteString); 78 table_.Register(kVisitSeqTwoByteString, &VisitSeqTwoByteString);
79 79
80 table_.Register(kVisitJSFunction, &VisitJSFunction); 80 table_.Register(kVisitJSFunction, &VisitJSFunction);
81 81
82 table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer); 82 table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer);
83 83
84 table_.Register(kVisitJSTypedArray, &VisitJSTypedArray); 84 table_.Register(kVisitJSTypedArray, &VisitJSTypedArray);
85 85
86 table_.Register(kVisitJSDataView, &VisitJSDataView);
87
86 table_.Register(kVisitFreeSpace, &VisitFreeSpace); 88 table_.Register(kVisitFreeSpace, &VisitFreeSpace);
87 89
88 table_.Register(kVisitJSWeakMap, &JSObjectVisitor::Visit); 90 table_.Register(kVisitJSWeakMap, &JSObjectVisitor::Visit);
89 91
90 table_.Register(kVisitJSRegExp, &JSObjectVisitor::Visit); 92 table_.Register(kVisitJSRegExp, &JSObjectVisitor::Visit);
91 93
92 table_.template RegisterSpecializations<DataObjectVisitor, 94 table_.template RegisterSpecializations<DataObjectVisitor,
93 kVisitDataObject, 95 kVisitDataObject,
94 kVisitDataObjectGeneric>(); 96 kVisitDataObjectGeneric>();
95 97
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 VisitPointers( 135 VisitPointers(
134 map->GetHeap(), 136 map->GetHeap(),
135 HeapObject::RawField(object, 137 HeapObject::RawField(object,
136 JSTypedArray::kWeakNextOffset + kPointerSize), 138 JSTypedArray::kWeakNextOffset + kPointerSize),
137 HeapObject::RawField(object, JSTypedArray::kSize)); 139 HeapObject::RawField(object, JSTypedArray::kSize));
138 return JSTypedArray::kSize; 140 return JSTypedArray::kSize;
139 } 141 }
140 142
141 143
142 template<typename StaticVisitor> 144 template<typename StaticVisitor>
145 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSDataView(
146 Map* map, HeapObject* object) {
147 VisitPointers(
148 map->GetHeap(),
149 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset),
150 HeapObject::RawField(object, JSDataView::kWeakNextOffset));
151 VisitPointers(
152 map->GetHeap(),
153 HeapObject::RawField(object,
154 JSDataView::kWeakNextOffset + kPointerSize),
155 HeapObject::RawField(object, JSDataView::kSize));
156 return JSDataView::kSize;
157 }
158
159
160 template<typename StaticVisitor>
143 void StaticMarkingVisitor<StaticVisitor>::Initialize() { 161 void StaticMarkingVisitor<StaticVisitor>::Initialize() {
144 table_.Register(kVisitShortcutCandidate, 162 table_.Register(kVisitShortcutCandidate,
145 &FixedBodyVisitor<StaticVisitor, 163 &FixedBodyVisitor<StaticVisitor,
146 ConsString::BodyDescriptor, 164 ConsString::BodyDescriptor,
147 void>::Visit); 165 void>::Visit);
148 166
149 table_.Register(kVisitConsString, 167 table_.Register(kVisitConsString,
150 &FixedBodyVisitor<StaticVisitor, 168 &FixedBodyVisitor<StaticVisitor,
151 ConsString::BodyDescriptor, 169 ConsString::BodyDescriptor,
152 void>::Visit); 170 void>::Visit);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 table_.Register(kVisitCode, &VisitCode); 205 table_.Register(kVisitCode, &VisitCode);
188 206
189 table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo); 207 table_.Register(kVisitSharedFunctionInfo, &VisitSharedFunctionInfo);
190 208
191 table_.Register(kVisitJSFunction, &VisitJSFunction); 209 table_.Register(kVisitJSFunction, &VisitJSFunction);
192 210
193 table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer); 211 table_.Register(kVisitJSArrayBuffer, &VisitJSArrayBuffer);
194 212
195 table_.Register(kVisitJSTypedArray, &VisitJSTypedArray); 213 table_.Register(kVisitJSTypedArray, &VisitJSTypedArray);
196 214
215 table_.Register(kVisitJSDataView, &VisitJSDataView);
216
197 // Registration for kVisitJSRegExp is done by StaticVisitor. 217 // Registration for kVisitJSRegExp is done by StaticVisitor.
198 218
199 table_.Register(kVisitCell, 219 table_.Register(kVisitCell,
200 &FixedBodyVisitor<StaticVisitor, 220 &FixedBodyVisitor<StaticVisitor,
201 Cell::BodyDescriptor, 221 Cell::BodyDescriptor,
202 void>::Visit); 222 void>::Visit);
203 223
204 table_.Register(kVisitPropertyCell, 224 table_.Register(kVisitPropertyCell,
205 &FixedBodyVisitor<StaticVisitor, 225 &FixedBodyVisitor<StaticVisitor,
206 PropertyCell::BodyDescriptor, 226 PropertyCell::BodyDescriptor,
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset)); 499 HeapObject::RawField(object, JSTypedArray::kWeakNextOffset));
480 StaticVisitor::VisitPointers( 500 StaticVisitor::VisitPointers(
481 map->GetHeap(), 501 map->GetHeap(),
482 HeapObject::RawField(object, 502 HeapObject::RawField(object,
483 JSTypedArray::kWeakNextOffset + kPointerSize), 503 JSTypedArray::kWeakNextOffset + kPointerSize),
484 HeapObject::RawField(object, JSTypedArray::kSize)); 504 HeapObject::RawField(object, JSTypedArray::kSize));
485 } 505 }
486 506
487 507
488 template<typename StaticVisitor> 508 template<typename StaticVisitor>
509 void StaticMarkingVisitor<StaticVisitor>::VisitJSDataView(
510 Map* map, HeapObject* object) {
511 StaticVisitor::VisitPointers(
512 map->GetHeap(),
513 HeapObject::RawField(object, JSDataView::BodyDescriptor::kStartOffset),
514 HeapObject::RawField(object, JSDataView::kWeakNextOffset));
515 StaticVisitor::VisitPointers(
516 map->GetHeap(),
517 HeapObject::RawField(object,
518 JSDataView::kWeakNextOffset + kPointerSize),
519 HeapObject::RawField(object, JSDataView::kSize));
520 }
521
522
523 template<typename StaticVisitor>
489 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents( 524 void StaticMarkingVisitor<StaticVisitor>::MarkMapContents(
490 Heap* heap, Map* map) { 525 Heap* heap, Map* map) {
491 // Make sure that the back pointer stored either in the map itself or 526 // Make sure that the back pointer stored either in the map itself or
492 // inside its transitions array is marked. Skip recording the back 527 // inside its transitions array is marked. Skip recording the back
493 // pointer slot since map space is not compacted. 528 // pointer slot since map space is not compacted.
494 StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer())); 529 StaticVisitor::MarkObject(heap, HeapObject::cast(map->GetBackPointer()));
495 530
496 // Treat pointers in the transitions array as weak and also mark that 531 // Treat pointers in the transitions array as weak and also mark that
497 // array to prevent visiting it later. Skip recording the transition 532 // array to prevent visiting it later. Skip recording the transition
498 // array slot, since it will be implicitly recorded when the pointer 533 // array slot, since it will be implicitly recorded when the pointer
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
817 RelocIterator it(this, mode_mask); 852 RelocIterator it(this, mode_mask);
818 for (; !it.done(); it.next()) { 853 for (; !it.done(); it.next()) {
819 it.rinfo()->template Visit<StaticVisitor>(heap); 854 it.rinfo()->template Visit<StaticVisitor>(heap);
820 } 855 }
821 } 856 }
822 857
823 858
824 } } // namespace v8::internal 859 } } // namespace v8::internal
825 860
826 #endif // V8_OBJECTS_VISITING_INL_H_ 861 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698