OLD | NEW |
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 <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 1388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1399 } | 1399 } |
1400 if (IsJSObject()) { | 1400 if (IsJSObject()) { |
1401 HeapStringAllocator allocator; | 1401 HeapStringAllocator allocator; |
1402 StringStream accumulator(&allocator); | 1402 StringStream accumulator(&allocator); |
1403 JSObject::cast(this)->JSObjectShortPrint(&accumulator); | 1403 JSObject::cast(this)->JSObjectShortPrint(&accumulator); |
1404 os << accumulator.ToCString().get(); | 1404 os << accumulator.ToCString().get(); |
1405 return; | 1405 return; |
1406 } | 1406 } |
1407 switch (map()->instance_type()) { | 1407 switch (map()->instance_type()) { |
1408 case MAP_TYPE: | 1408 case MAP_TYPE: |
1409 os << "<Map(elements=" << Map::cast(this)->elements_kind() << ")>"; | 1409 os << "<Map(" << ElementsKindToString(Map::cast(this)->elements_kind()) |
| 1410 << ")>"; |
1410 break; | 1411 break; |
1411 case FIXED_ARRAY_TYPE: | 1412 case FIXED_ARRAY_TYPE: |
1412 os << "<FixedArray[" << FixedArray::cast(this)->length() << "]>"; | 1413 os << "<FixedArray[" << FixedArray::cast(this)->length() << "]>"; |
1413 break; | 1414 break; |
1414 case FIXED_DOUBLE_ARRAY_TYPE: | 1415 case FIXED_DOUBLE_ARRAY_TYPE: |
1415 os << "<FixedDoubleArray[" << FixedDoubleArray::cast(this)->length() | 1416 os << "<FixedDoubleArray[" << FixedDoubleArray::cast(this)->length() |
1416 << "]>"; | 1417 << "]>"; |
1417 break; | 1418 break; |
1418 case BYTE_ARRAY_TYPE: | 1419 case BYTE_ARRAY_TYPE: |
1419 os << "<ByteArray[" << ByteArray::cast(this)->length() << "]>"; | 1420 os << "<ByteArray[" << ByteArray::cast(this)->length() << "]>"; |
(...skipping 1531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2951 split_attributes = new_attributes; | 2952 split_attributes = new_attributes; |
2952 } else { | 2953 } else { |
2953 PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof); | 2954 PropertyDetails split_prop_details = old_descriptors->GetDetails(split_nof); |
2954 split_kind = split_prop_details.kind(); | 2955 split_kind = split_prop_details.kind(); |
2955 split_attributes = split_prop_details.attributes(); | 2956 split_attributes = split_prop_details.attributes(); |
2956 } | 2957 } |
2957 bool transition_target_deprecated = split_map->DeprecateTarget( | 2958 bool transition_target_deprecated = split_map->DeprecateTarget( |
2958 split_kind, old_descriptors->GetKey(split_nof), split_attributes, | 2959 split_kind, old_descriptors->GetKey(split_nof), split_attributes, |
2959 *new_descriptors, *new_layout_descriptor); | 2960 *new_descriptors, *new_layout_descriptor); |
2960 | 2961 |
| 2962 if (from_kind != to_kind) { |
| 2963 // There was an elements kind change in the middle of transition tree and |
| 2964 // we reconstructed the tree so that all elements kind transitions are |
| 2965 // done at the beginning, therefore the |old_map| is no longer stable. |
| 2966 old_map->NotifyLeafMapLayoutChange(); |
| 2967 } |
| 2968 |
2961 // If |transition_target_deprecated| is true then the transition array | 2969 // If |transition_target_deprecated| is true then the transition array |
2962 // already contains entry for given descriptor. This means that the transition | 2970 // already contains entry for given descriptor. This means that the transition |
2963 // could be inserted regardless of whether transitions array is full or not. | 2971 // could be inserted regardless of whether transitions array is full or not. |
2964 if (!transition_target_deprecated && | 2972 if (!transition_target_deprecated && |
2965 !TransitionArray::CanHaveMoreTransitions(split_map)) { | 2973 !TransitionArray::CanHaveMoreTransitions(split_map)) { |
2966 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, | 2974 return CopyGeneralizeAllRepresentations(old_map, modify_index, store_mode, |
2967 new_kind, new_attributes, | 2975 new_kind, new_attributes, |
2968 "GenAll_CantHaveMoreTransitions"); | 2976 "GenAll_CantHaveMoreTransitions"); |
2969 } | 2977 } |
2970 | 2978 |
(...skipping 14267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17238 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, | 17246 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
17239 Handle<Object> new_value) { | 17247 Handle<Object> new_value) { |
17240 if (cell->value() != *new_value) { | 17248 if (cell->value() != *new_value) { |
17241 cell->set_value(*new_value); | 17249 cell->set_value(*new_value); |
17242 Isolate* isolate = cell->GetIsolate(); | 17250 Isolate* isolate = cell->GetIsolate(); |
17243 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17251 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17244 isolate, DependentCode::kPropertyCellChangedGroup); | 17252 isolate, DependentCode::kPropertyCellChangedGroup); |
17245 } | 17253 } |
17246 } | 17254 } |
17247 } } // namespace v8::internal | 17255 } } // namespace v8::internal |
OLD | NEW |