Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 // Not using specialized Api object visitor for newspace. | 94 // Not using specialized Api object visitor for newspace. |
| 95 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSApiObject, | 95 table_.template RegisterSpecializations<JSObjectVisitor, kVisitJSApiObject, |
| 96 kVisitJSApiObjectGeneric>(); | 96 kVisitJSApiObjectGeneric>(); |
| 97 | 97 |
| 98 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, | 98 table_.template RegisterSpecializations<StructVisitor, kVisitStruct, |
| 99 kVisitStructGeneric>(); | 99 kVisitStructGeneric>(); |
| 100 } | 100 } |
| 101 | 101 |
| 102 | 102 |
| 103 template <typename StaticVisitor> | 103 template <typename StaticVisitor> |
| 104 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( | 104 int StaticNewSpaceVisitor<StaticVisitor>::VisitJSArrayBuffer( |
|
Hannes Payer (out of office)
2016/06/01 13:44:17
This method is not needed anymore. You can use the
Michael Lippautz
2016/06/01 14:19:19
Done.
| |
| 105 Map* map, HeapObject* object) { | 105 Map* map, HeapObject* object) { |
| 106 typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, int> | 106 typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, int> |
| 107 JSArrayBufferBodyVisitor; | 107 JSArrayBufferBodyVisitor; |
| 108 | |
| 109 if (!JSArrayBuffer::cast(object)->is_external()) { | |
| 110 Heap* heap = map->GetHeap(); | |
| 111 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); | |
| 112 } | |
| 113 return JSArrayBufferBodyVisitor::Visit(map, object); | 108 return JSArrayBufferBodyVisitor::Visit(map, object); |
| 114 } | 109 } |
| 115 | 110 |
| 116 | 111 |
| 117 template <typename StaticVisitor> | 112 template <typename StaticVisitor> |
| 118 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( | 113 int StaticNewSpaceVisitor<StaticVisitor>::VisitBytecodeArray( |
| 119 Map* map, HeapObject* object) { | 114 Map* map, HeapObject* object) { |
| 120 VisitPointers( | 115 VisitPointers( |
| 121 map->GetHeap(), object, | 116 map->GetHeap(), object, |
| 122 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), | 117 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 template <typename StaticVisitor> | 512 template <typename StaticVisitor> |
| 518 void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp(Map* map, | 513 void StaticMarkingVisitor<StaticVisitor>::VisitJSRegExp(Map* map, |
| 519 HeapObject* object) { | 514 HeapObject* object) { |
| 520 JSObjectVisitor::Visit(map, object); | 515 JSObjectVisitor::Visit(map, object); |
| 521 } | 516 } |
| 522 | 517 |
| 523 | 518 |
| 524 template <typename StaticVisitor> | 519 template <typename StaticVisitor> |
| 525 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( | 520 void StaticMarkingVisitor<StaticVisitor>::VisitJSArrayBuffer( |
| 526 Map* map, HeapObject* object) { | 521 Map* map, HeapObject* object) { |
| 527 Heap* heap = map->GetHeap(); | |
| 528 | |
| 529 typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, | 522 typedef FlexibleBodyVisitor<StaticVisitor, JSArrayBuffer::BodyDescriptor, |
| 530 void> JSArrayBufferBodyVisitor; | 523 void> JSArrayBufferBodyVisitor; |
| 531 | |
| 532 JSArrayBufferBodyVisitor::Visit(map, object); | 524 JSArrayBufferBodyVisitor::Visit(map, object); |
| 533 | |
| 534 if (!JSArrayBuffer::cast(object)->is_external() && | |
| 535 !heap->InNewSpace(object)) { | |
| 536 heap->array_buffer_tracker()->MarkLive(JSArrayBuffer::cast(object)); | |
| 537 } | |
| 538 } | 525 } |
| 539 | 526 |
| 540 | 527 |
| 541 template <typename StaticVisitor> | 528 template <typename StaticVisitor> |
| 542 void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray( | 529 void StaticMarkingVisitor<StaticVisitor>::VisitBytecodeArray( |
| 543 Map* map, HeapObject* object) { | 530 Map* map, HeapObject* object) { |
| 544 StaticVisitor::VisitPointers( | 531 StaticVisitor::VisitPointers( |
| 545 map->GetHeap(), object, | 532 map->GetHeap(), object, |
| 546 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), | 533 HeapObject::RawField(object, BytecodeArray::kConstantPoolOffset), |
| 547 HeapObject::RawField(object, BytecodeArray::kFrameSizeOffset)); | 534 HeapObject::RawField(object, BytecodeArray::kFrameSizeOffset)); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 732 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, | 719 typedef FlexibleBodyVisitor<StaticVisitor, JSFunction::BodyDescriptorWeakCode, |
| 733 void> JSFunctionWeakCodeBodyVisitor; | 720 void> JSFunctionWeakCodeBodyVisitor; |
| 734 JSFunctionWeakCodeBodyVisitor::Visit(map, object); | 721 JSFunctionWeakCodeBodyVisitor::Visit(map, object); |
| 735 } | 722 } |
| 736 | 723 |
| 737 | 724 |
| 738 } // namespace internal | 725 } // namespace internal |
| 739 } // namespace v8 | 726 } // namespace v8 |
| 740 | 727 |
| 741 #endif // V8_OBJECTS_VISITING_INL_H_ | 728 #endif // V8_OBJECTS_VISITING_INL_H_ |
| OLD | NEW |