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

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

Issue 1133773002: Keep track of array buffers in new space separately (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 7 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
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 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 template <typename StaticVisitor> 78 template <typename StaticVisitor>
79 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( 79 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
80 Map* map, HeapObject* object) { 80 Map* map, HeapObject* object) {
81 Heap* heap = map->GetHeap(); 81 Heap* heap = map->GetHeap();
82 82
83 VisitPointers( 83 VisitPointers(
84 heap, 84 heap,
85 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), 85 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
86 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); 86 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
87 if (!JSArrayBuffer::cast(object)->is_external()) {
88 heap->RegisterLiveArrayBuffer(true,
89 JSArrayBuffer::cast(object)->backing_store());
90 }
87 return JSArrayBuffer::kSizeWithInternalFields; 91 return JSArrayBuffer::kSizeWithInternalFields;
88 } 92 }
89 93
90 94
91 template <typename StaticVisitor> 95 template <typename StaticVisitor>
92 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( 96 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray(
93 Map* map, HeapObject* object) { 97 Map* map, HeapObject* object) {
94 VisitPointers( 98 VisitPointers(
95 map->GetHeap(), 99 map->GetHeap(),
96 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), 100 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset),
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 template <typename StaticVisitor> 529 template <typename StaticVisitor>
526 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( 530 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
527 Map* map, HeapObject* object) { 531 Map* map, HeapObject* object) {
528 Heap* heap = map->GetHeap(); 532 Heap* heap = map->GetHeap();
529 533
530 StaticVisitor::VisitPointers( 534 StaticVisitor::VisitPointers(
531 heap, 535 heap,
532 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), 536 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
533 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); 537 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
534 if (!JSArrayBuffer::cast(object)->is_external()) { 538 if (!JSArrayBuffer::cast(object)->is_external()) {
535 heap->RegisterLiveArrayBuffer(JSArrayBuffer::cast(object)->backing_store()); 539 heap->RegisterLiveArrayBuffer(heap->InNewSpace(object),
540 JSArrayBuffer::cast(object)->backing_store());
536 } 541 }
537 } 542 }
538 543
539 544
540 template <typename StaticVisitor> 545 template <typename StaticVisitor>
541 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( 546 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray(
542 Map* map, HeapObject* object) { 547 Map* map, HeapObject* object) {
543 StaticVisitor::VisitPointers( 548 StaticVisitor::VisitPointers(
544 map->GetHeap(), 549 map->GetHeap(),
545 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), 550 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset),
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 875
871 RelocIterator it(this, mode_mask); 876 RelocIterator it(this, mode_mask);
872 for (; !it.done(); it.next()) { 877 for (; !it.done(); it.next()) {
873 it.rinfo()->template Visit<StaticVisitor>(heap); 878 it.rinfo()->template Visit<StaticVisitor>(heap);
874 } 879 }
875 } 880 }
876 } 881 }
877 } // namespace v8::internal 882 } // namespace v8::internal
878 883
879 #endif // V8_OBJECTS_VISITING_INL_H_ 884 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« src/heap/mark-compact.cc ('K') | « src/heap/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698