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

Side by Side Diff: src/layout-descriptor.cc

Issue 2504193002: [heap] Simplify adjusting of live bytes. (Closed)
Patch Set: fix test Created 4 years, 1 month 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/isolate.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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/layout-descriptor.h" 5 #include "src/layout-descriptor.h"
6 6
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/handles-inl.h" 10 #include "src/handles-inl.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // It must not become fast-mode descriptor here, because otherwise it has to 238 // It must not become fast-mode descriptor here, because otherwise it has to
239 // be fast pointer layout descriptor already but it's is slow mode now. 239 // be fast pointer layout descriptor already but it's is slow mode now.
240 DCHECK_LT(kSmiValueSize, layout_descriptor_length); 240 DCHECK_LT(kSmiValueSize, layout_descriptor_length);
241 241
242 // Trim, clean and reinitialize this slow-mode layout descriptor. 242 // Trim, clean and reinitialize this slow-mode layout descriptor.
243 int array_length = GetSlowModeBackingStoreLength(layout_descriptor_length); 243 int array_length = GetSlowModeBackingStoreLength(layout_descriptor_length);
244 int current_length = length(); 244 int current_length = length();
245 if (current_length != array_length) { 245 if (current_length != array_length) {
246 DCHECK_LT(array_length, current_length); 246 DCHECK_LT(array_length, current_length);
247 int delta = current_length - array_length; 247 int delta = current_length - array_length;
248 heap->RightTrimFixedArray<Heap::SEQUENTIAL_TO_SWEEPER>(this, delta); 248 heap->RightTrimFixedArray(this, delta);
249 } 249 }
250 memset(DataPtr(), 0, DataSize()); 250 memset(DataPtr(), 0, DataSize());
251 LayoutDescriptor* layout_descriptor = 251 LayoutDescriptor* layout_descriptor =
252 Initialize(this, map, descriptors, num_descriptors); 252 Initialize(this, map, descriptors, num_descriptors);
253 DCHECK_EQ(this, layout_descriptor); 253 DCHECK_EQ(this, layout_descriptor);
254 return layout_descriptor; 254 return layout_descriptor;
255 } 255 }
256 256
257 257
258 bool LayoutDescriptor::IsConsistentWithMap(Map* map, bool check_tail) { 258 bool LayoutDescriptor::IsConsistentWithMap(Map* map, bool check_tail) {
(...skipping 20 matching lines...) Expand all
279 int n = capacity(); 279 int n = capacity();
280 for (int i = last_field_index; i < n; i++) { 280 for (int i = last_field_index; i < n; i++) {
281 DCHECK(IsTagged(i)); 281 DCHECK(IsTagged(i));
282 } 282 }
283 } 283 }
284 } 284 }
285 return true; 285 return true;
286 } 286 }
287 } // namespace internal 287 } // namespace internal
288 } // namespace v8 288 } // namespace v8
OLDNEW
« no previous file with comments | « src/isolate.cc ('k') | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698