OLD | NEW |
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 // Review notes: | 5 // Review notes: |
6 // | 6 // |
7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
10 // | 10 // |
(...skipping 5288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5299 } | 5299 } |
5300 | 5300 |
5301 | 5301 |
5302 void Map::UpdateDescriptors(DescriptorArray* descriptors, | 5302 void Map::UpdateDescriptors(DescriptorArray* descriptors, |
5303 LayoutDescriptor* layout_desc) { | 5303 LayoutDescriptor* layout_desc) { |
5304 set_instance_descriptors(descriptors); | 5304 set_instance_descriptors(descriptors); |
5305 if (FLAG_unbox_double_fields) { | 5305 if (FLAG_unbox_double_fields) { |
5306 if (layout_descriptor()->IsSlowLayout()) { | 5306 if (layout_descriptor()->IsSlowLayout()) { |
5307 set_layout_descriptor(layout_desc); | 5307 set_layout_descriptor(layout_desc); |
5308 } | 5308 } |
| 5309 #ifdef VERIFY_HEAP |
| 5310 // TODO(ishell): remove these checks from VERIFY_HEAP mode. |
| 5311 if (FLAG_verify_heap) { |
| 5312 CHECK(layout_descriptor()->IsConsistentWithMap(this)); |
| 5313 CHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); |
| 5314 } |
| 5315 #else |
5309 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5316 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); |
5310 DCHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); | 5317 DCHECK(visitor_id() == StaticVisitorBase::GetVisitorId(this)); |
| 5318 #endif |
5311 } | 5319 } |
5312 } | 5320 } |
5313 | 5321 |
5314 | 5322 |
5315 void Map::InitializeDescriptors(DescriptorArray* descriptors, | 5323 void Map::InitializeDescriptors(DescriptorArray* descriptors, |
5316 LayoutDescriptor* layout_desc) { | 5324 LayoutDescriptor* layout_desc) { |
5317 int len = descriptors->number_of_descriptors(); | 5325 int len = descriptors->number_of_descriptors(); |
5318 set_instance_descriptors(descriptors); | 5326 set_instance_descriptors(descriptors); |
5319 SetNumberOfOwnDescriptors(len); | 5327 SetNumberOfOwnDescriptors(len); |
5320 | 5328 |
5321 if (FLAG_unbox_double_fields) { | 5329 if (FLAG_unbox_double_fields) { |
5322 set_layout_descriptor(layout_desc); | 5330 set_layout_descriptor(layout_desc); |
| 5331 #ifdef VERIFY_HEAP |
| 5332 // TODO(ishell): remove these checks from VERIFY_HEAP mode. |
| 5333 if (FLAG_verify_heap) { |
| 5334 CHECK(layout_descriptor()->IsConsistentWithMap(this)); |
| 5335 } |
| 5336 #else |
5323 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); | 5337 SLOW_DCHECK(layout_descriptor()->IsConsistentWithMap(this)); |
| 5338 #endif |
5324 set_visitor_id(StaticVisitorBase::GetVisitorId(this)); | 5339 set_visitor_id(StaticVisitorBase::GetVisitorId(this)); |
5325 } | 5340 } |
5326 } | 5341 } |
5327 | 5342 |
5328 | 5343 |
5329 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) | 5344 ACCESSORS(Map, instance_descriptors, DescriptorArray, kDescriptorsOffset) |
5330 ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDecriptorOffset) | 5345 ACCESSORS(Map, layout_descriptor, LayoutDescriptor, kLayoutDecriptorOffset) |
5331 | 5346 |
5332 | 5347 |
5333 void Map::set_bit_field3(uint32_t bits) { | 5348 void Map::set_bit_field3(uint32_t bits) { |
(...skipping 2278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7612 #undef READ_SHORT_FIELD | 7627 #undef READ_SHORT_FIELD |
7613 #undef WRITE_SHORT_FIELD | 7628 #undef WRITE_SHORT_FIELD |
7614 #undef READ_BYTE_FIELD | 7629 #undef READ_BYTE_FIELD |
7615 #undef WRITE_BYTE_FIELD | 7630 #undef WRITE_BYTE_FIELD |
7616 #undef NOBARRIER_READ_BYTE_FIELD | 7631 #undef NOBARRIER_READ_BYTE_FIELD |
7617 #undef NOBARRIER_WRITE_BYTE_FIELD | 7632 #undef NOBARRIER_WRITE_BYTE_FIELD |
7618 | 7633 |
7619 } } // namespace v8::internal | 7634 } } // namespace v8::internal |
7620 | 7635 |
7621 #endif // V8_OBJECTS_INL_H_ | 7636 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |