| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |