| 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 3631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3642 } | 3642 } |
| 3643 } | 3643 } |
| 3644 } | 3644 } |
| 3645 return transition == nullptr ? Handle<Map>() : handle(transition); | 3645 return transition == nullptr ? Handle<Map>() : handle(transition); |
| 3646 } | 3646 } |
| 3647 | 3647 |
| 3648 | 3648 |
| 3649 static Map* FindClosestElementsTransition(Map* map, ElementsKind to_kind) { | 3649 static Map* FindClosestElementsTransition(Map* map, ElementsKind to_kind) { |
| 3650 Map* current_map = map; | 3650 Map* current_map = map; |
| 3651 | 3651 |
| 3652 // Support for legacy API: SetIndexedPropertiesTo{External,Pixel}Data | |
| 3653 // allows to change elements from arbitrary kind to any ExternalArray | |
| 3654 // elements kind. Satisfy its requirements, checking whether we already | |
| 3655 // have the cached transition. | |
| 3656 if (IsExternalArrayElementsKind(to_kind) && | |
| 3657 !IsFixedTypedArrayElementsKind(map->elements_kind())) { | |
| 3658 Map* next_map = map->ElementsTransitionMap(); | |
| 3659 if (next_map != NULL && next_map->elements_kind() == to_kind) { | |
| 3660 return next_map; | |
| 3661 } | |
| 3662 return map; | |
| 3663 } | |
| 3664 | |
| 3665 ElementsKind kind = map->elements_kind(); | 3652 ElementsKind kind = map->elements_kind(); |
| 3666 while (kind != to_kind) { | 3653 while (kind != to_kind) { |
| 3667 Map* next_map = current_map->ElementsTransitionMap(); | 3654 Map* next_map = current_map->ElementsTransitionMap(); |
| 3668 if (next_map == nullptr) return current_map; | 3655 if (next_map == nullptr) return current_map; |
| 3669 kind = next_map->elements_kind(); | 3656 kind = next_map->elements_kind(); |
| 3670 current_map = next_map; | 3657 current_map = next_map; |
| 3671 } | 3658 } |
| 3672 | 3659 |
| 3673 DCHECK_EQ(to_kind, current_map->elements_kind()); | 3660 DCHECK_EQ(to_kind, current_map->elements_kind()); |
| 3674 return current_map; | 3661 return current_map; |
| (...skipping 12234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15909 Handle<Object> new_value) { | 15896 Handle<Object> new_value) { |
| 15910 if (cell->value() != *new_value) { | 15897 if (cell->value() != *new_value) { |
| 15911 cell->set_value(*new_value); | 15898 cell->set_value(*new_value); |
| 15912 Isolate* isolate = cell->GetIsolate(); | 15899 Isolate* isolate = cell->GetIsolate(); |
| 15913 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 15900 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
| 15914 isolate, DependentCode::kPropertyCellChangedGroup); | 15901 isolate, DependentCode::kPropertyCellChangedGroup); |
| 15915 } | 15902 } |
| 15916 } | 15903 } |
| 15917 } // namespace internal | 15904 } // namespace internal |
| 15918 } // namespace v8 | 15905 } // namespace v8 |
| OLD | NEW |