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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 | 259 |
260 | 260 |
261 #ifdef VERIFY_HEAP | |
262 bool LayoutDescriptor::IsConsistentWithMap(Map* map) { | 261 bool LayoutDescriptor::IsConsistentWithMap(Map* map) { |
263 if (FLAG_unbox_double_fields) { | 262 if (FLAG_unbox_double_fields) { |
264 DescriptorArray* descriptors = map->instance_descriptors(); | 263 DescriptorArray* descriptors = map->instance_descriptors(); |
265 int nof_descriptors = map->NumberOfOwnDescriptors(); | 264 int nof_descriptors = map->NumberOfOwnDescriptors(); |
266 for (int i = 0; i < nof_descriptors; i++) { | 265 for (int i = 0; i < nof_descriptors; i++) { |
267 PropertyDetails details = descriptors->GetDetails(i); | 266 PropertyDetails details = descriptors->GetDetails(i); |
268 if (details.type() != DATA) continue; | 267 if (details.type() != DATA) continue; |
269 FieldIndex field_index = FieldIndex::ForDescriptor(map, i); | 268 FieldIndex field_index = FieldIndex::ForDescriptor(map, i); |
270 bool tagged_expected = | 269 bool tagged_expected = |
271 !field_index.is_inobject() || !details.representation().IsDouble(); | 270 !field_index.is_inobject() || !details.representation().IsDouble(); |
272 for (int bit = 0; bit < details.field_width_in_words(); bit++) { | 271 for (int bit = 0; bit < details.field_width_in_words(); bit++) { |
273 bool tagged_actual = IsTagged(details.field_index() + bit); | 272 bool tagged_actual = IsTagged(details.field_index() + bit); |
274 DCHECK_EQ(tagged_expected, tagged_actual); | 273 DCHECK_EQ(tagged_expected, tagged_actual); |
275 if (tagged_actual != tagged_expected) return false; | 274 if (tagged_actual != tagged_expected) return false; |
276 } | 275 } |
277 } | 276 } |
278 } | 277 } |
279 return true; | 278 return true; |
280 } | 279 } |
281 #endif | |
282 } | 280 } |
283 } // namespace v8::internal | 281 } // namespace v8::internal |
OLD | NEW |