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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/layout-descriptor.h" | 10 #include "src/layout-descriptor.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 *out_end_of_contiguous_region_offset = header_size_; | 249 *out_end_of_contiguous_region_offset = header_size_; |
250 } | 250 } |
251 DCHECK(offset_in_bytes < *out_end_of_contiguous_region_offset); | 251 DCHECK(offset_in_bytes < *out_end_of_contiguous_region_offset); |
252 return true; | 252 return true; |
253 } | 253 } |
254 *out_end_of_contiguous_region_offset = | 254 *out_end_of_contiguous_region_offset = |
255 offset_in_bytes + sequence_length * kPointerSize; | 255 offset_in_bytes + sequence_length * kPointerSize; |
256 DCHECK(offset_in_bytes < *out_end_of_contiguous_region_offset); | 256 DCHECK(offset_in_bytes < *out_end_of_contiguous_region_offset); |
257 return tagged; | 257 return tagged; |
258 } | 258 } |
| 259 |
| 260 |
| 261 #ifdef VERIFY_HEAP |
| 262 bool LayoutDescriptor::IsConsistentWithMap(Map* map) { |
| 263 if (FLAG_unbox_double_fields) { |
| 264 DescriptorArray* descriptors = map->instance_descriptors(); |
| 265 int nof_descriptors = map->NumberOfOwnDescriptors(); |
| 266 for (int i = 0; i < nof_descriptors; i++) { |
| 267 PropertyDetails details = descriptors->GetDetails(i); |
| 268 if (details.type() != DATA) continue; |
| 269 FieldIndex field_index = FieldIndex::ForDescriptor(map, i); |
| 270 bool tagged_expected = |
| 271 !field_index.is_inobject() || !details.representation().IsDouble(); |
| 272 for (int bit = 0; bit < details.field_width_in_words(); bit++) { |
| 273 bool tagged_actual = IsTagged(details.field_index() + bit); |
| 274 DCHECK_EQ(tagged_expected, tagged_actual); |
| 275 if (tagged_actual != tagged_expected) return false; |
| 276 } |
| 277 } |
| 278 } |
| 279 return true; |
| 280 } |
| 281 #endif |
259 } | 282 } |
260 } // namespace v8::internal | 283 } // namespace v8::internal |
OLD | NEW |