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

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, 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
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/objects.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/objects-visiting.h" 8 #include "src/heap/objects-visiting.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 template <typename StaticVisitor> 79 template <typename StaticVisitor>
80 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( 80 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer(
81 Map* map, HeapObject* object) { 81 Map* map, HeapObject* object) {
82 Heap* heap = map->GetHeap(); 82 Heap* heap = map->GetHeap();
83 83
84 VisitPointers( 84 VisitPointers(
85 heap, 85 heap,
86 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), 86 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
87 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); 87 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
88 if (!JSArrayBuffer::cast(object)->is_external()) {
89 heap->RegisterLiveArrayBuffer(true,
90 JSArrayBuffer::cast(object)->backing_store());
91 }
88 return JSArrayBuffer::kSizeWithInternalFields; 92 return JSArrayBuffer::kSizeWithInternalFields;
89 } 93 }
90 94
91 95
92 template <typename StaticVisitor> 96 template <typename StaticVisitor>
93 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray( 97 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSTypedArray(
94 Map* map, HeapObject* object) { 98 Map* map, HeapObject* object) {
95 VisitPointers( 99 VisitPointers(
96 map->GetHeap(), 100 map->GetHeap(),
97 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), 101 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset),
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
497 template <typename StaticVisitor> 501 template <typename StaticVisitor>
498 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( 502 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer(
499 Map* map, HeapObject* object) { 503 Map* map, HeapObject* object) {
500 Heap* heap = map->GetHeap(); 504 Heap* heap = map->GetHeap();
501 505
502 StaticVisitor::VisitPointers( 506 StaticVisitor::VisitPointers(
503 heap, 507 heap,
504 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset), 508 HeapObject::RawField(object, JSArrayBuffer::BodyDescriptor::kStartOffset),
505 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields)); 509 HeapObject::RawField(object, JSArrayBuffer::kSizeWithInternalFields));
506 if (!JSArrayBuffer::cast(object)->is_external()) { 510 if (!JSArrayBuffer::cast(object)->is_external()) {
507 heap->RegisterLiveArrayBuffer(JSArrayBuffer::cast(object)->backing_store()); 511 heap->RegisterLiveArrayBuffer(heap->InNewSpace(object),
512 JSArrayBuffer::cast(object)->backing_store());
508 } 513 }
509 } 514 }
510 515
511 516
512 template <typename StaticVisitor> 517 template <typename StaticVisitor>
513 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray( 518 void StaticMarkingVisitor<StaticVisitor>::VisitJSTypedArray(
514 Map* map, HeapObject* object) { 519 Map* map, HeapObject* object) {
515 StaticVisitor::VisitPointers( 520 StaticVisitor::VisitPointers(
516 map->GetHeap(), 521 map->GetHeap(),
517 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset), 522 HeapObject::RawField(object, JSTypedArray::BodyDescriptor::kStartOffset),
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
831 836
832 RelocIterator it(this, mode_mask); 837 RelocIterator it(this, mode_mask);
833 for (; !it.done(); it.next()) { 838 for (; !it.done(); it.next()) {
834 it.rinfo()->template Visit<StaticVisitor>(heap); 839 it.rinfo()->template Visit<StaticVisitor>(heap);
835 } 840 }
836 } 841 }
837 } 842 }
838 } // namespace v8::internal 843 } // namespace v8::internal
839 844
840 #endif // V8_OBJECTS_VISITING_INL_H_ 845 #endif // V8_OBJECTS_VISITING_INL_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698