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

Side by Side Diff: src/heap/heap.cc

Issue 1834373003: [heap] Add optimized RecordWrites (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: adressing comments Created 4 years, 8 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 #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
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
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
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/heap-inl.h » ('j') | src/heap/heap-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698