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

Side by Side Diff: src/objects.cc

Issue 799723003: StoreMode enum values renamed. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 6 years 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/objects.h ('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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/accessors.h" 9 #include "src/accessors.h"
10 #include "src/allocation-site-scopes.h" 10 #include "src/allocation-site-scopes.h"
(...skipping 2196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2207 } 2207 }
2208 2208
2209 Handle<LayoutDescriptor> new_layout_descriptor( 2209 Handle<LayoutDescriptor> new_layout_descriptor(
2210 LayoutDescriptor::FastPointerLayout(), isolate); 2210 LayoutDescriptor::FastPointerLayout(), isolate);
2211 Handle<Map> new_map = CopyReplaceDescriptors( 2211 Handle<Map> new_map = CopyReplaceDescriptors(
2212 map, descriptors, new_layout_descriptor, OMIT_TRANSITION, 2212 map, descriptors, new_layout_descriptor, OMIT_TRANSITION,
2213 MaybeHandle<Name>(), reason, SPECIAL_TRANSITION); 2213 MaybeHandle<Name>(), reason, SPECIAL_TRANSITION);
2214 2214
2215 // Unless the instance is being migrated, ensure that modify_index is a field. 2215 // Unless the instance is being migrated, ensure that modify_index is a field.
2216 PropertyDetails details = descriptors->GetDetails(modify_index); 2216 PropertyDetails details = descriptors->GetDetails(modify_index);
2217 if (store_mode == FORCE_FIELD && 2217 if (store_mode == FORCE_IN_OBJECT &&
2218 (details.type() != FIELD || details.attributes() != attributes)) { 2218 (details.type() != FIELD || details.attributes() != attributes)) {
2219 int field_index = details.type() == FIELD ? details.field_index() 2219 int field_index = details.type() == FIELD ? details.field_index()
2220 : new_map->NumberOfFields(); 2220 : new_map->NumberOfFields();
2221 FieldDescriptor d(handle(descriptors->GetKey(modify_index), isolate), 2221 FieldDescriptor d(handle(descriptors->GetKey(modify_index), isolate),
2222 field_index, attributes, Representation::Tagged()); 2222 field_index, attributes, Representation::Tagged());
2223 descriptors->Replace(modify_index, &d); 2223 descriptors->Replace(modify_index, &d);
2224 if (details.type() != FIELD) { 2224 if (details.type() != FIELD) {
2225 int unused_property_fields = new_map->unused_property_fields() - 1; 2225 int unused_property_fields = new_map->unused_property_fields() - 1;
2226 if (unused_property_fields < 0) { 2226 if (unused_property_fields < 0) {
2227 unused_property_fields += JSObject::kFieldsAdded; 2227 unused_property_fields += JSObject::kFieldsAdded;
2228 } 2228 }
2229 new_map->set_unused_property_fields(unused_property_fields); 2229 new_map->set_unused_property_fields(unused_property_fields);
2230 } 2230 }
2231 } else { 2231 } else {
2232 DCHECK(details.attributes() == attributes); 2232 DCHECK(details.attributes() == attributes);
2233 } 2233 }
2234 2234
2235 if (FLAG_trace_generalization) { 2235 if (FLAG_trace_generalization) {
2236 HeapType* field_type = (details.type() == FIELD) 2236 HeapType* field_type = (details.type() == FIELD)
2237 ? map->instance_descriptors()->GetFieldType(modify_index) 2237 ? map->instance_descriptors()->GetFieldType(modify_index)
2238 : NULL; 2238 : NULL;
2239 map->PrintGeneralization(stdout, reason, modify_index, 2239 map->PrintGeneralization(
2240 new_map->NumberOfOwnDescriptors(), 2240 stdout, reason, modify_index, new_map->NumberOfOwnDescriptors(),
2241 new_map->NumberOfOwnDescriptors(), 2241 new_map->NumberOfOwnDescriptors(),
2242 details.type() == CONSTANT && store_mode == FORCE_FIELD, 2242 details.type() == CONSTANT && store_mode == FORCE_IN_OBJECT,
2243 details.representation(), Representation::Tagged(), 2243 details.representation(), Representation::Tagged(), field_type,
2244 field_type, HeapType::Any()); 2244 HeapType::Any());
2245 } 2245 }
2246 return new_map; 2246 return new_map;
2247 } 2247 }
2248 2248
2249 2249
2250 // static 2250 // static
2251 Handle<Map> Map::CopyGeneralizeAllRepresentations(Handle<Map> map, 2251 Handle<Map> Map::CopyGeneralizeAllRepresentations(Handle<Map> map,
2252 int modify_index, 2252 int modify_index,
2253 StoreMode store_mode, 2253 StoreMode store_mode,
2254 const char* reason) { 2254 const char* reason) {
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
2528 2528
2529 // Check the state of the root map. 2529 // Check the state of the root map.
2530 Handle<Map> root_map(old_map->FindRootMap(), isolate); 2530 Handle<Map> root_map(old_map->FindRootMap(), isolate);
2531 if (!old_map->EquivalentToForTransition(*root_map)) { 2531 if (!old_map->EquivalentToForTransition(*root_map)) {
2532 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, 2532 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode,
2533 "GenAll_NotEquivalent"); 2533 "GenAll_NotEquivalent");
2534 } 2534 }
2535 int root_nof = root_map->NumberOfOwnDescriptors(); 2535 int root_nof = root_map->NumberOfOwnDescriptors();
2536 if (modify_index < root_nof) { 2536 if (modify_index < root_nof) {
2537 PropertyDetails old_details = old_descriptors->GetDetails(modify_index); 2537 PropertyDetails old_details = old_descriptors->GetDetails(modify_index);
2538 if ((old_details.type() != FIELD && store_mode == FORCE_FIELD) || 2538 if ((old_details.type() != FIELD && store_mode == FORCE_IN_OBJECT) ||
2539 (old_details.type() == FIELD && 2539 (old_details.type() == FIELD &&
2540 (!new_field_type->NowIs(old_descriptors->GetFieldType(modify_index)) || 2540 (!new_field_type->NowIs(old_descriptors->GetFieldType(modify_index)) ||
2541 !new_representation.fits_into(old_details.representation())))) { 2541 !new_representation.fits_into(old_details.representation())))) {
2542 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, 2542 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode,
2543 "GenAll_RootModification"); 2543 "GenAll_RootModification");
2544 } 2544 }
2545 } 2545 }
2546 2546
2547 Handle<Map> target_map = root_map; 2547 Handle<Map> target_map = root_map;
2548 for (int i = root_nof; i < old_nof; ++i) { 2548 for (int i = root_nof; i < old_nof; ++i) {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
2594 DCHECK_EQ(tmp_descriptors->GetValue(i), old_descriptors->GetValue(i)); 2594 DCHECK_EQ(tmp_descriptors->GetValue(i), old_descriptors->GetValue(i));
2595 } 2595 }
2596 target_map = tmp_map; 2596 target_map = tmp_map;
2597 } 2597 }
2598 2598
2599 // Directly change the map if the target map is more general. 2599 // Directly change the map if the target map is more general.
2600 Handle<DescriptorArray> target_descriptors( 2600 Handle<DescriptorArray> target_descriptors(
2601 target_map->instance_descriptors(), isolate); 2601 target_map->instance_descriptors(), isolate);
2602 int target_nof = target_map->NumberOfOwnDescriptors(); 2602 int target_nof = target_map->NumberOfOwnDescriptors();
2603 if (target_nof == old_nof && 2603 if (target_nof == old_nof &&
2604 (store_mode != FORCE_FIELD || 2604 (store_mode != FORCE_IN_OBJECT ||
2605 target_descriptors->GetDetails(modify_index).type() == FIELD)) { 2605 target_descriptors->GetDetails(modify_index).type() == FIELD)) {
2606 DCHECK(modify_index < target_nof); 2606 DCHECK(modify_index < target_nof);
2607 DCHECK(new_representation.fits_into( 2607 DCHECK(new_representation.fits_into(
2608 target_descriptors->GetDetails(modify_index).representation())); 2608 target_descriptors->GetDetails(modify_index).representation()));
2609 DCHECK(target_descriptors->GetDetails(modify_index).type() != FIELD || 2609 DCHECK(target_descriptors->GetDetails(modify_index).type() != FIELD ||
2610 new_field_type->NowIs( 2610 new_field_type->NowIs(
2611 target_descriptors->GetFieldType(modify_index))); 2611 target_descriptors->GetFieldType(modify_index)));
2612 return target_map; 2612 return target_map;
2613 } 2613 }
2614 2614
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
2669 PropertyDetails old_details = old_descriptors->GetDetails(i); 2669 PropertyDetails old_details = old_descriptors->GetDetails(i);
2670 PropertyDetails target_details = target_descriptors->GetDetails(i); 2670 PropertyDetails target_details = target_descriptors->GetDetails(i);
2671 target_details = target_details.CopyWithRepresentation( 2671 target_details = target_details.CopyWithRepresentation(
2672 old_details.representation().generalize( 2672 old_details.representation().generalize(
2673 target_details.representation())); 2673 target_details.representation()));
2674 if (modify_index == i) { 2674 if (modify_index == i) {
2675 target_details = target_details.CopyWithRepresentation( 2675 target_details = target_details.CopyWithRepresentation(
2676 new_representation.generalize(target_details.representation())); 2676 new_representation.generalize(target_details.representation()));
2677 } 2677 }
2678 DCHECK_EQ(old_details.attributes(), target_details.attributes()); 2678 DCHECK_EQ(old_details.attributes(), target_details.attributes());
2679 if (old_details.type() == FIELD || 2679 if (old_details.type() == FIELD || target_details.type() == FIELD ||
2680 target_details.type() == FIELD || 2680 (modify_index == i && store_mode == FORCE_IN_OBJECT) ||
2681 (modify_index == i && store_mode == FORCE_FIELD) ||
2682 (target_descriptors->GetValue(i) != old_descriptors->GetValue(i))) { 2681 (target_descriptors->GetValue(i) != old_descriptors->GetValue(i))) {
2683 Handle<HeapType> old_field_type = (old_details.type() == FIELD) 2682 Handle<HeapType> old_field_type = (old_details.type() == FIELD)
2684 ? handle(old_descriptors->GetFieldType(i), isolate) 2683 ? handle(old_descriptors->GetFieldType(i), isolate)
2685 : old_descriptors->GetValue(i)->OptimalType( 2684 : old_descriptors->GetValue(i)->OptimalType(
2686 isolate, target_details.representation()); 2685 isolate, target_details.representation());
2687 Handle<HeapType> target_field_type = (target_details.type() == FIELD) 2686 Handle<HeapType> target_field_type = (target_details.type() == FIELD)
2688 ? handle(target_descriptors->GetFieldType(i), isolate) 2687 ? handle(target_descriptors->GetFieldType(i), isolate)
2689 : target_descriptors->GetValue(i)->OptimalType( 2688 : target_descriptors->GetValue(i)->OptimalType(
2690 isolate, target_details.representation()); 2689 isolate, target_details.representation());
2691 target_field_type = GeneralizeFieldType( 2690 target_field_type = GeneralizeFieldType(
(...skipping 30 matching lines...) Expand all
2722 if (modify_index == i) { 2721 if (modify_index == i) {
2723 old_field_type = GeneralizeFieldType( 2722 old_field_type = GeneralizeFieldType(
2724 old_field_type, new_field_type, isolate); 2723 old_field_type, new_field_type, isolate);
2725 } 2724 }
2726 FieldDescriptor d(old_key, current_offset, old_field_type, 2725 FieldDescriptor d(old_key, current_offset, old_field_type,
2727 old_details.attributes(), old_details.representation()); 2726 old_details.attributes(), old_details.representation());
2728 current_offset += d.GetDetails().field_width_in_words(); 2727 current_offset += d.GetDetails().field_width_in_words();
2729 new_descriptors->Set(i, &d); 2728 new_descriptors->Set(i, &d);
2730 } else { 2729 } else {
2731 DCHECK(old_details.type() == CONSTANT || old_details.type() == CALLBACKS); 2730 DCHECK(old_details.type() == CONSTANT || old_details.type() == CALLBACKS);
2732 if (modify_index == i && store_mode == FORCE_FIELD) { 2731 if (modify_index == i && store_mode == FORCE_IN_OBJECT) {
2733 FieldDescriptor d( 2732 FieldDescriptor d(
2734 old_key, current_offset, 2733 old_key, current_offset,
2735 GeneralizeFieldType(old_descriptors->GetValue(i)->OptimalType( 2734 GeneralizeFieldType(old_descriptors->GetValue(i)->OptimalType(
2736 isolate, old_details.representation()), 2735 isolate, old_details.representation()),
2737 new_field_type, isolate), 2736 new_field_type, isolate),
2738 old_details.attributes(), old_details.representation()); 2737 old_details.attributes(), old_details.representation());
2739 current_offset += d.GetDetails().field_width_in_words(); 2738 current_offset += d.GetDetails().field_width_in_words();
2740 new_descriptors->Set(i, &d); 2739 new_descriptors->Set(i, &d);
2741 } else { 2740 } else {
2742 DCHECK_NE(FIELD, old_details.type()); 2741 DCHECK_NE(FIELD, old_details.type());
2743 Descriptor d(old_key, 2742 Descriptor d(old_key,
2744 handle(old_descriptors->GetValue(i), isolate), 2743 handle(old_descriptors->GetValue(i), isolate),
2745 old_details); 2744 old_details);
2746 new_descriptors->Set(i, &d); 2745 new_descriptors->Set(i, &d);
2747 } 2746 }
2748 } 2747 }
2749 } 2748 }
2750 2749
2751 new_descriptors->Sort(); 2750 new_descriptors->Sort();
2752 2751
2753 DCHECK(store_mode != FORCE_FIELD || 2752 DCHECK(store_mode != FORCE_IN_OBJECT ||
2754 new_descriptors->GetDetails(modify_index).type() == FIELD); 2753 new_descriptors->GetDetails(modify_index).type() == FIELD);
2755 2754
2756 Handle<Map> split_map(root_map->FindLastMatchMap( 2755 Handle<Map> split_map(root_map->FindLastMatchMap(
2757 root_nof, old_nof, *new_descriptors), isolate); 2756 root_nof, old_nof, *new_descriptors), isolate);
2758 int split_nof = split_map->NumberOfOwnDescriptors(); 2757 int split_nof = split_map->NumberOfOwnDescriptors();
2759 DCHECK_NE(old_nof, split_nof); 2758 DCHECK_NE(old_nof, split_nof);
2760 2759
2761 Handle<LayoutDescriptor> new_layout_descriptor = 2760 Handle<LayoutDescriptor> new_layout_descriptor =
2762 LayoutDescriptor::New(split_map, new_descriptors, old_nof); 2761 LayoutDescriptor::New(split_map, new_descriptors, old_nof);
2763 PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof); 2762 PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof);
(...skipping 16 matching lines...) Expand all
2780 Handle<HeapType> old_field_type = (old_details.type() == FIELD) 2779 Handle<HeapType> old_field_type = (old_details.type() == FIELD)
2781 ? handle(old_descriptors->GetFieldType(modify_index), isolate) 2780 ? handle(old_descriptors->GetFieldType(modify_index), isolate)
2782 : HeapType::Constant(handle(old_descriptors->GetValue(modify_index), 2781 : HeapType::Constant(handle(old_descriptors->GetValue(modify_index),
2783 isolate), isolate); 2782 isolate), isolate);
2784 Handle<HeapType> new_field_type = (new_details.type() == FIELD) 2783 Handle<HeapType> new_field_type = (new_details.type() == FIELD)
2785 ? handle(new_descriptors->GetFieldType(modify_index), isolate) 2784 ? handle(new_descriptors->GetFieldType(modify_index), isolate)
2786 : HeapType::Constant(handle(new_descriptors->GetValue(modify_index), 2785 : HeapType::Constant(handle(new_descriptors->GetValue(modify_index),
2787 isolate), isolate); 2786 isolate), isolate);
2788 old_map->PrintGeneralization( 2787 old_map->PrintGeneralization(
2789 stdout, "", modify_index, split_nof, old_nof, 2788 stdout, "", modify_index, split_nof, old_nof,
2790 old_details.type() == CONSTANT && store_mode == FORCE_FIELD, 2789 old_details.type() == CONSTANT && store_mode == FORCE_IN_OBJECT,
2791 old_details.representation(), new_details.representation(), 2790 old_details.representation(), new_details.representation(),
2792 *old_field_type, *new_field_type); 2791 *old_field_type, *new_field_type);
2793 } 2792 }
2794 2793
2795 // Add missing transitions. 2794 // Add missing transitions.
2796 Handle<Map> new_map = split_map; 2795 Handle<Map> new_map = split_map;
2797 for (int i = split_nof; i < old_nof; ++i) { 2796 for (int i = split_nof; i < old_nof; ++i) {
2798 new_map = CopyInstallDescriptors(new_map, i, new_descriptors, 2797 new_map = CopyInstallDescriptors(new_map, i, new_descriptors,
2799 new_layout_descriptor); 2798 new_layout_descriptor);
2800 } 2799 }
2801 new_map->set_owns_descriptors(true); 2800 new_map->set_owns_descriptors(true);
2802 return new_map; 2801 return new_map;
2803 } 2802 }
2804 2803
2805 2804
2806 // Generalize the representation of all FIELD descriptors. 2805 // Generalize the representation of all FIELD descriptors.
2807 Handle<Map> Map::GeneralizeAllFieldRepresentations( 2806 Handle<Map> Map::GeneralizeAllFieldRepresentations(
2808 Handle<Map> map) { 2807 Handle<Map> map) {
2809 Handle<DescriptorArray> descriptors(map->instance_descriptors()); 2808 Handle<DescriptorArray> descriptors(map->instance_descriptors());
2810 for (int i = 0; i < map->NumberOfOwnDescriptors(); ++i) { 2809 for (int i = 0; i < map->NumberOfOwnDescriptors(); ++i) {
2811 if (descriptors->GetDetails(i).type() == FIELD) { 2810 if (descriptors->GetDetails(i).type() == FIELD) {
2812 map = GeneralizeRepresentation(map, i, Representation::Tagged(), 2811 map = GeneralizeRepresentation(map, i, Representation::Tagged(),
2813 HeapType::Any(map->GetIsolate()), 2812 HeapType::Any(map->GetIsolate()),
2814 FORCE_FIELD); 2813 FORCE_IN_OBJECT);
2815 } 2814 }
2816 } 2815 }
2817 return map; 2816 return map;
2818 } 2817 }
2819 2818
2820 2819
2821 // static 2820 // static
2822 MaybeHandle<Map> Map::TryUpdate(Handle<Map> map) { 2821 MaybeHandle<Map> Map::TryUpdate(Handle<Map> map) {
2823 Handle<Map> proto_map(map); 2822 Handle<Map> proto_map(map);
2824 while (proto_map->prototype()->IsJSObject()) { 2823 while (proto_map->prototype()->IsJSObject()) {
2825 Handle<JSObject> holder(JSObject::cast(proto_map->prototype())); 2824 Handle<JSObject> holder(JSObject::cast(proto_map->prototype()));
2826 proto_map = Handle<Map>(holder->map()); 2825 proto_map = Handle<Map>(holder->map());
2827 if (proto_map->is_deprecated() && JSObject::TryMigrateInstance(holder)) { 2826 if (proto_map->is_deprecated() && JSObject::TryMigrateInstance(holder)) {
2828 proto_map = Handle<Map>(holder->map()); 2827 proto_map = Handle<Map>(holder->map());
2829 } 2828 }
2830 } 2829 }
2831 return TryUpdateInternal(map); 2830 return TryUpdateInternal(map);
2832 } 2831 }
2833 2832
2834 2833
2835 // static 2834 // static
2836 Handle<Map> Map::Update(Handle<Map> map) { 2835 Handle<Map> Map::Update(Handle<Map> map) {
2837 if (!map->is_deprecated()) return map; 2836 if (!map->is_deprecated()) return map;
2838 return GeneralizeRepresentation(map, 0, Representation::None(), 2837 return GeneralizeRepresentation(map, 0, Representation::None(),
2839 HeapType::None(map->GetIsolate()), 2838 HeapType::None(map->GetIsolate()),
2840 ALLOW_AS_CONSTANT); 2839 ALLOW_IN_DESCRIPTOR);
2841 } 2840 }
2842 2841
2843 2842
2844 // static 2843 // static
2845 MaybeHandle<Map> Map::TryUpdateInternal(Handle<Map> old_map) { 2844 MaybeHandle<Map> Map::TryUpdateInternal(Handle<Map> old_map) {
2846 DisallowHeapAllocation no_allocation; 2845 DisallowHeapAllocation no_allocation;
2847 DisallowDeoptimization no_deoptimization(old_map->GetIsolate()); 2846 DisallowDeoptimization no_deoptimization(old_map->GetIsolate());
2848 2847
2849 if (!old_map->is_deprecated()) return old_map; 2848 if (!old_map->is_deprecated()) return old_map;
2850 2849
(...skipping 4261 matching lines...) Expand 10 before | Expand all | Expand 10 after
7112 7111
7113 Handle<DescriptorArray> descriptors(map->instance_descriptors()); 7112 Handle<DescriptorArray> descriptors(map->instance_descriptors());
7114 7113
7115 if (descriptors->CanHoldValue(descriptor, *value)) return map; 7114 if (descriptors->CanHoldValue(descriptor, *value)) return map;
7116 7115
7117 Isolate* isolate = map->GetIsolate(); 7116 Isolate* isolate = map->GetIsolate();
7118 Representation representation = value->OptimalRepresentation(); 7117 Representation representation = value->OptimalRepresentation();
7119 Handle<HeapType> type = value->OptimalType(isolate, representation); 7118 Handle<HeapType> type = value->OptimalType(isolate, representation);
7120 7119
7121 return GeneralizeRepresentation(map, descriptor, representation, type, 7120 return GeneralizeRepresentation(map, descriptor, representation, type,
7122 FORCE_FIELD); 7121 FORCE_IN_OBJECT);
7123 } 7122 }
7124 7123
7125 7124
7126 Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name, 7125 Handle<Map> Map::TransitionToDataProperty(Handle<Map> map, Handle<Name> name,
7127 Handle<Object> value, 7126 Handle<Object> value,
7128 PropertyAttributes attributes, 7127 PropertyAttributes attributes,
7129 StoreFromKeyed store_mode) { 7128 StoreFromKeyed store_mode) {
7130 // Dictionary maps can always have additional data properties. 7129 // Dictionary maps can always have additional data properties.
7131 if (map->is_dictionary_map()) return map; 7130 if (map->is_dictionary_map()) return map;
7132 7131
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
7176 } 7175 }
7177 7176
7178 7177
7179 Handle<Map> Map::ReconfigureDataProperty(Handle<Map> map, int descriptor, 7178 Handle<Map> Map::ReconfigureDataProperty(Handle<Map> map, int descriptor,
7180 PropertyAttributes attributes) { 7179 PropertyAttributes attributes) {
7181 // Dictionaries have to be reconfigured in-place. 7180 // Dictionaries have to be reconfigured in-place.
7182 DCHECK(!map->is_dictionary_map()); 7181 DCHECK(!map->is_dictionary_map());
7183 7182
7184 // For now, give up on transitioning and just create a unique map. 7183 // For now, give up on transitioning and just create a unique map.
7185 // TODO(verwaest/ishell): Cache transitions with different attributes. 7184 // TODO(verwaest/ishell): Cache transitions with different attributes.
7186 return CopyGeneralizeAllRepresentations( 7185 return CopyGeneralizeAllRepresentations(map, descriptor, FORCE_IN_OBJECT,
7187 map, descriptor, FORCE_FIELD, attributes, "GenAll_AttributesMismatch"); 7186 attributes,
7187 "GenAll_AttributesMismatch");
7188 } 7188 }
7189 7189
7190 7190
7191 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, 7191 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map,
7192 Handle<Name> name, 7192 Handle<Name> name,
7193 AccessorComponent component, 7193 AccessorComponent component,
7194 Handle<Object> accessor, 7194 Handle<Object> accessor,
7195 PropertyAttributes attributes) { 7195 PropertyAttributes attributes) {
7196 Isolate* isolate = name->GetIsolate(); 7196 Isolate* isolate = name->GetIsolate();
7197 7197
(...skipping 9733 matching lines...) Expand 10 before | Expand all | Expand 10 after
16931 Handle<DependentCode> codes = 16931 Handle<DependentCode> codes =
16932 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()), 16932 DependentCode::Insert(handle(cell->dependent_code(), info->isolate()),
16933 DependentCode::kPropertyCellChangedGroup, 16933 DependentCode::kPropertyCellChangedGroup,
16934 info->object_wrapper()); 16934 info->object_wrapper());
16935 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 16935 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
16936 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 16936 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
16937 cell, info->zone()); 16937 cell, info->zone());
16938 } 16938 }
16939 16939
16940 } } // namespace v8::internal 16940 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698