| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 "src/objects.h" | 5 #include "src/objects.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <sstream> | 10 #include <sstream> |
| (...skipping 9141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9152 Handle<Object> value) { | 9152 Handle<Object> value) { |
| 9153 if (CanHoldValue(map->instance_descriptors(), descriptor, *value)) return map; | 9153 if (CanHoldValue(map->instance_descriptors(), descriptor, *value)) return map; |
| 9154 | 9154 |
| 9155 Isolate* isolate = map->GetIsolate(); | 9155 Isolate* isolate = map->GetIsolate(); |
| 9156 PropertyAttributes attributes = | 9156 PropertyAttributes attributes = |
| 9157 map->instance_descriptors()->GetDetails(descriptor).attributes(); | 9157 map->instance_descriptors()->GetDetails(descriptor).attributes(); |
| 9158 Representation representation = value->OptimalRepresentation(); | 9158 Representation representation = value->OptimalRepresentation(); |
| 9159 Handle<FieldType> type = value->OptimalType(isolate, representation); | 9159 Handle<FieldType> type = value->OptimalType(isolate, representation); |
| 9160 | 9160 |
| 9161 MapUpdater mu(isolate, map); | 9161 MapUpdater mu(isolate, map); |
| 9162 return mu.ReconfigureToDataField(descriptor, attributes, representation, | 9162 Handle<Map> new_map = |
| 9163 type); | 9163 mu.ReconfigureToDataField(descriptor, attributes, representation, type); |
| 9164 new_map->set_migration_target(true); |
| 9165 return new_map; |
| 9164 } | 9166 } |
| 9165 | 9167 |
| 9166 } // namespace | 9168 } // namespace |
| 9167 | 9169 |
| 9168 // static | 9170 // static |
| 9169 Handle<Map> Map::PrepareForDataProperty(Handle<Map> map, int descriptor, | 9171 Handle<Map> Map::PrepareForDataProperty(Handle<Map> map, int descriptor, |
| 9170 Handle<Object> value) { | 9172 Handle<Object> value) { |
| 9171 // Dictionaries can store any property value. | 9173 // Dictionaries can store any property value. |
| 9172 DCHECK(!map->is_dictionary_map()); | 9174 DCHECK(!map->is_dictionary_map()); |
| 9173 // Update to the newest map before storing the property. | 9175 // Update to the newest map before storing the property. |
| (...skipping 10719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 19893 // depend on this. | 19895 // depend on this. |
| 19894 return DICTIONARY_ELEMENTS; | 19896 return DICTIONARY_ELEMENTS; |
| 19895 } | 19897 } |
| 19896 DCHECK_LE(kind, LAST_ELEMENTS_KIND); | 19898 DCHECK_LE(kind, LAST_ELEMENTS_KIND); |
| 19897 return kind; | 19899 return kind; |
| 19898 } | 19900 } |
| 19899 } | 19901 } |
| 19900 | 19902 |
| 19901 } // namespace internal | 19903 } // namespace internal |
| 19902 } // namespace v8 | 19904 } // namespace v8 |
| OLD | NEW |