Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(261)

Side by Side Diff: test/cctest/test-unboxed-doubles.cc

Issue 2624903003: [runtime] Use PropertyKind/PropertyLocation instead of PropertyType. (Closed)
Patch Set: Addressing comments Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/value-serializer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 767 matching lines...) Expand 10 before | Expand all | Expand 10 after
778 for (int i = 0; i < number_of_descriptors; i++) { 778 for (int i = 0; i < number_of_descriptors; i++) {
779 PropertyDetails details = descriptors->GetDetails(i); 779 PropertyDetails details = descriptors->GetDetails(i);
780 map = maps[i]; 780 map = maps[i];
781 LayoutDescriptor* layout_desc = map->layout_descriptor(); 781 LayoutDescriptor* layout_desc = map->layout_descriptor();
782 782
783 if (layout_desc->IsSlowLayout()) { 783 if (layout_desc->IsSlowLayout()) {
784 switched_to_slow_mode = true; 784 switched_to_slow_mode = true;
785 CHECK_EQ(*full_layout_descriptor, layout_desc); 785 CHECK_EQ(*full_layout_descriptor, layout_desc);
786 } else { 786 } else {
787 CHECK(!switched_to_slow_mode); 787 CHECK(!switched_to_slow_mode);
788 if (details.type() == DATA) { 788 if (details.location() == kField) {
789 nof++; 789 nof++;
790 int field_index = details.field_index(); 790 int field_index = details.field_index();
791 int field_width_in_words = details.field_width_in_words(); 791 int field_width_in_words = details.field_width_in_words();
792 792
793 bool is_inobject = field_index < map->GetInObjectProperties(); 793 bool is_inobject = field_index < map->GetInObjectProperties();
794 for (int bit = 0; bit < field_width_in_words; bit++) { 794 for (int bit = 0; bit < field_width_in_words; bit++) {
795 CHECK_EQ(is_inobject && details.representation().IsDouble(), 795 CHECK_EQ(is_inobject && details.representation().IsDouble(),
796 !layout_desc->IsTagged(field_index + bit)); 796 !layout_desc->IsTagged(field_index + bit));
797 } 797 }
798 CHECK(layout_desc->IsTagged(field_index + field_width_in_words)); 798 CHECK(layout_desc->IsTagged(field_index + field_width_in_words));
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
1186 1186
1187 LayoutDescriptorHelper helper(*map); 1187 LayoutDescriptorHelper helper(*map);
1188 bool all_fields_tagged = true; 1188 bool all_fields_tagged = true;
1189 1189
1190 int instance_size = map->instance_size(); 1190 int instance_size = map->instance_size();
1191 1191
1192 int end_offset = instance_size * 2; 1192 int end_offset = instance_size * 2;
1193 int first_non_tagged_field_offset = end_offset; 1193 int first_non_tagged_field_offset = end_offset;
1194 for (int i = 0; i < number_of_descriptors; i++) { 1194 for (int i = 0; i < number_of_descriptors; i++) {
1195 PropertyDetails details = descriptors->GetDetails(i); 1195 PropertyDetails details = descriptors->GetDetails(i);
1196 if (details.type() != DATA) continue; 1196 if (details.location() != kField) continue;
1197 FieldIndex index = FieldIndex::ForDescriptor(*map, i); 1197 FieldIndex index = FieldIndex::ForDescriptor(*map, i);
1198 if (!index.is_inobject()) continue; 1198 if (!index.is_inobject()) continue;
1199 all_fields_tagged &= !details.representation().IsDouble(); 1199 all_fields_tagged &= !details.representation().IsDouble();
1200 bool expected_tagged = !index.is_double(); 1200 bool expected_tagged = !index.is_double();
1201 if (!expected_tagged) { 1201 if (!expected_tagged) {
1202 first_non_tagged_field_offset = 1202 first_non_tagged_field_offset =
1203 Min(first_non_tagged_field_offset, index.offset()); 1203 Min(first_non_tagged_field_offset, index.offset());
1204 } 1204 }
1205 1205
1206 int end_of_region_offset; 1206 int end_of_region_offset;
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
1556 1556
1557 // TODO(ishell): add respective tests for property kind reconfiguring from 1557 // TODO(ishell): add respective tests for property kind reconfiguring from
1558 // accessor field to double, once accessor fields are supported by 1558 // accessor field to double, once accessor fields are supported by
1559 // Map::ReconfigureProperty(). 1559 // Map::ReconfigureProperty().
1560 1560
1561 1561
1562 // TODO(ishell): add respective tests for fast property removal case once 1562 // TODO(ishell): add respective tests for fast property removal case once
1563 // Map::ReconfigureProperty() supports that. 1563 // Map::ReconfigureProperty() supports that.
1564 1564
1565 #endif 1565 #endif
OLDNEW
« no previous file with comments | « src/value-serializer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698