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 #include "src/heap/heap.h" | 5 #include "src/heap/heap.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/api.h" | 8 #include "src/api.h" |
| 9 #include "src/ast/scopeinfo.h" | 9 #include "src/ast/scopeinfo.h" |
| 10 #include "src/base/bits.h" | 10 #include "src/base/bits.h" |
| (...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1103 } | 1103 } |
| 1104 | 1104 |
| 1105 | 1105 |
| 1106 void Heap::MoveElements(FixedArray* array, int dst_index, int src_index, | 1106 void Heap::MoveElements(FixedArray* array, int dst_index, int src_index, |
| 1107 int len) { | 1107 int len) { |
| 1108 if (len == 0) return; | 1108 if (len == 0) return; |
| 1109 | 1109 |
| 1110 DCHECK(array->map() != fixed_cow_array_map()); | 1110 DCHECK(array->map() != fixed_cow_array_map()); |
| 1111 Object** dst_objects = array->data_start() + dst_index; | 1111 Object** dst_objects = array->data_start() + dst_index; |
| 1112 MemMove(dst_objects, array->data_start() + src_index, len * kPointerSize); | 1112 MemMove(dst_objects, array->data_start() + src_index, len * kPointerSize); |
| 1113 if (!InNewSpace(array)) { | 1113 FIXED_ARRAY_ELEMENTS_WRITE_BARRIER(this, array, dst_index, src_index); |
|
ulan
2016/04/11 12:49:23
src_index should be len.
| |
| 1114 for (int i = 0; i < len; i++) { | |
| 1115 RecordWrite(array, array->OffsetOfElementAt(dst_index + i), | |
| 1116 dst_objects[i]); | |
| 1117 } | |
| 1118 } | |
| 1119 incremental_marking()->IterateBlackObject(array); | |
| 1120 } | 1114 } |
| 1121 | 1115 |
| 1122 | 1116 |
| 1123 #ifdef VERIFY_HEAP | 1117 #ifdef VERIFY_HEAP |
| 1124 // Helper class for verifying the string table. | 1118 // Helper class for verifying the string table. |
| 1125 class StringTableVerifier : public ObjectVisitor { | 1119 class StringTableVerifier : public ObjectVisitor { |
| 1126 public: | 1120 public: |
| 1127 void VisitPointers(Object** start, Object** end) override { | 1121 void VisitPointers(Object** start, Object** end) override { |
| 1128 // Visit all HeapObject pointers in [start, end). | 1122 // Visit all HeapObject pointers in [start, end). |
| 1129 for (Object** p = start; p < end; p++) { | 1123 for (Object** p = start; p < end; p++) { |
| (...skipping 5343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6473 } | 6467 } |
| 6474 | 6468 |
| 6475 | 6469 |
| 6476 // static | 6470 // static |
| 6477 int Heap::GetStaticVisitorIdForMap(Map* map) { | 6471 int Heap::GetStaticVisitorIdForMap(Map* map) { |
| 6478 return StaticVisitorBase::GetVisitorId(map); | 6472 return StaticVisitorBase::GetVisitorId(map); |
| 6479 } | 6473 } |
| 6480 | 6474 |
| 6481 } // namespace internal | 6475 } // namespace internal |
| 6482 } // namespace v8 | 6476 } // namespace v8 |
| OLD | NEW |