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 <stdlib.h> | 5 #include <stdlib.h> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/compilation-cache.h" | 10 #include "src/compilation-cache.h" |
(...skipping 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 descriptors->Append(&d); | 627 descriptors->Append(&d); |
628 | 628 |
629 } else { | 629 } else { |
630 DataDescriptor f(name, next_field_offset, NONE, representations[kind]); | 630 DataDescriptor f(name, next_field_offset, NONE, representations[kind]); |
631 int field_width_in_words = f.GetDetails().field_width_in_words(); | 631 int field_width_in_words = f.GetDetails().field_width_in_words(); |
632 next_field_offset += field_width_in_words; | 632 next_field_offset += field_width_in_words; |
633 layout_descriptor = LayoutDescriptor::ShareAppend(map, f.GetDetails()); | 633 layout_descriptor = LayoutDescriptor::ShareAppend(map, f.GetDetails()); |
634 descriptors->Append(&f); | 634 descriptors->Append(&f); |
635 | 635 |
636 int field_index = f.GetDetails().field_index(); | 636 int field_index = f.GetDetails().field_index(); |
637 bool is_inobject = field_index < map->inobject_properties(); | 637 bool is_inobject = field_index < map->GetInObjectProperties(); |
638 for (int bit = 0; bit < field_width_in_words; bit++) { | 638 for (int bit = 0; bit < field_width_in_words; bit++) { |
639 CHECK_EQ(is_inobject && (kind == PROP_DOUBLE), | 639 CHECK_EQ(is_inobject && (kind == PROP_DOUBLE), |
640 !layout_descriptor->IsTagged(field_index + bit)); | 640 !layout_descriptor->IsTagged(field_index + bit)); |
641 } | 641 } |
642 CHECK(layout_descriptor->IsTagged(next_field_offset)); | 642 CHECK(layout_descriptor->IsTagged(next_field_offset)); |
643 } | 643 } |
644 map->InitializeDescriptors(*descriptors, *layout_descriptor); | 644 map->InitializeDescriptors(*descriptors, *layout_descriptor); |
645 } | 645 } |
646 Handle<LayoutDescriptor> layout_descriptor(map->layout_descriptor(), isolate); | 646 Handle<LayoutDescriptor> layout_descriptor(map->layout_descriptor(), isolate); |
647 CHECK(layout_descriptor->IsConsistentWithMap(*map, true)); | 647 CHECK(layout_descriptor->IsConsistentWithMap(*map, true)); |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 if (layout_desc->IsSlowLayout()) { | 756 if (layout_desc->IsSlowLayout()) { |
757 switched_to_slow_mode = true; | 757 switched_to_slow_mode = true; |
758 CHECK_EQ(*full_layout_descriptor, layout_desc); | 758 CHECK_EQ(*full_layout_descriptor, layout_desc); |
759 } else { | 759 } else { |
760 CHECK(!switched_to_slow_mode); | 760 CHECK(!switched_to_slow_mode); |
761 if (details.type() == DATA) { | 761 if (details.type() == DATA) { |
762 nof++; | 762 nof++; |
763 int field_index = details.field_index(); | 763 int field_index = details.field_index(); |
764 int field_width_in_words = details.field_width_in_words(); | 764 int field_width_in_words = details.field_width_in_words(); |
765 | 765 |
766 bool is_inobject = field_index < map->inobject_properties(); | 766 bool is_inobject = field_index < map->GetInObjectProperties(); |
767 for (int bit = 0; bit < field_width_in_words; bit++) { | 767 for (int bit = 0; bit < field_width_in_words; bit++) { |
768 CHECK_EQ(is_inobject && details.representation().IsDouble(), | 768 CHECK_EQ(is_inobject && details.representation().IsDouble(), |
769 !layout_desc->IsTagged(field_index + bit)); | 769 !layout_desc->IsTagged(field_index + bit)); |
770 } | 770 } |
771 CHECK(layout_desc->IsTagged(field_index + field_width_in_words)); | 771 CHECK(layout_desc->IsTagged(field_index + field_width_in_words)); |
772 } | 772 } |
773 } | 773 } |
774 CHECK(map->layout_descriptor()->IsConsistentWithMap(*map)); | 774 CHECK(map->layout_descriptor()->IsConsistentWithMap(*map)); |
775 } | 775 } |
776 | 776 |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 | 1680 |
1681 // TODO(ishell): add respective tests for property kind reconfiguring from | 1681 // TODO(ishell): add respective tests for property kind reconfiguring from |
1682 // accessor field to double, once accessor fields are supported by | 1682 // accessor field to double, once accessor fields are supported by |
1683 // Map::ReconfigureProperty(). | 1683 // Map::ReconfigureProperty(). |
1684 | 1684 |
1685 | 1685 |
1686 // TODO(ishell): add respective tests for fast property removal case once | 1686 // TODO(ishell): add respective tests for fast property removal case once |
1687 // Map::ReconfigureProperty() supports that. | 1687 // Map::ReconfigureProperty() supports that. |
1688 | 1688 |
1689 #endif | 1689 #endif |
OLD | NEW |