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

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

Issue 1327403002: [objects] do not visit ArrayBuffer's backing store (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: visit all fields in array buffer, reorder fields for simplicity Created 5 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
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | src/heap/store-buffer.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/objects-visiting.h" 9 #include "src/heap/objects-visiting.h"
10 #include "src/ic/ic-state.h" 10 #include "src/ic/ic-state.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, 85 table_.template RegisterSpecializations<StructVisitor, kVisitStruct,
86 kVisitStructGeneric>(); 86 kVisitStructGeneric>();
87 } 87 }
88 88
89 89
90 template <typename StaticVisitor> 90 template <typename StaticVisitor>
91 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( 91 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
92 Map* map, HeapObject* object) { 92 Map* map, HeapObject* object) {
93 Heap* heap = map->GetHeap(); 93 Heap* heap = map->GetHeap();
94 94
95 VisitPointers( 95 JSArrayBuffer::JSArrayBufferIterateBody<
96 heap, object, 96 StaticNewSpaceVisitor<StaticVisitor> >(heap, object);
97 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
98 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
99 if (!JSArrayBuffer::cast(object)->is_external()) { 97 if (!JSArrayBuffer::cast(object)->is_external()) {
100 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); 98 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object));
101 } 99 }
102 return JSArrayBuffer::kSizeWithInternalFields; 100 return JSArrayBuffer::kSizeWithInternalFields;
103 } 101 }
104 102
105 103
106 template <typename StaticVisitor> 104 template <typename StaticVisitor>
107 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( 105 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray(
108 Map* map, HeapObject* object) { 106 Map* map, HeapObject* object) {
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 HeapObject::RawField(object, JSRegExp::kPropertiesOffset), 519 HeapObject::RawField(object, JSRegExp::kPropertiesOffset),
522 HeapObject::RawField(object, last_property_offset)); 520 HeapObject::RawField(object, last_property_offset));
523 } 521 }
524 522
525 523
526 template <typename StaticVisitor> 524 template <typename StaticVisitor>
527 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( 525 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
528 Map* map, HeapObject* object) { 526 Map* map, HeapObject* object) {
529 Heap* heap = map->GetHeap(); 527 Heap* heap = map->GetHeap();
530 528
531 StaticVisitor::VisitPointers( 529 JSArrayBuffer::JSArrayBufferIterateBody<StaticVisitor>(heap, object);
532 heap, object,
533 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
534 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
535 if (!JSArrayBuffer::cast(object)->is_external() && 530 if (!JSArrayBuffer::cast(object)->is_external() &&
536 !heap->InNewSpace(object)) { 531 !heap->InNewSpace(object)) {
537 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); 532 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object));
538 } 533 }
539 } 534 }
540 535
541 536
542 template <typename StaticVisitor> 537 template <typename StaticVisitor>
543 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( 538 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray(
544 Map* map, HeapObject* object) { 539 Map* map, HeapObject* object) {
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
892 887
893 RelocIterator it(this, mode_mask); 888 RelocIterator it(this, mode_mask);
894 for (; !it.done(); it.next()) { 889 for (; !it.done(); it.next()) {
895 it.rinfo()->template Visit<StaticVisitor>(heap); 890 it.rinfo()->template Visit<StaticVisitor>(heap);
896 } 891 }
897 } 892 }
898 } 893 }
899 } // namespace v8::internal 894 } // namespace v8::internal
900 895
901 #endif // V8_OBJECTS_VISITING_INL_H_ 896 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/objects-visiting.cc ('k') | src/heap/store-buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698