Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 68151dbf324c99699c880545606ec874734412f7..6d94c1006b1c582a0cfdd25e762383a7e6f40167 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -3379,9 +3379,16 @@ static Map* FindClosestElementsTransition(Map* map, ElementsKind to_kind) { |
? to_kind |
: TERMINAL_FAST_ELEMENTS_KIND; |
- // Support for legacy API. |
+ // Support for legacy API: SetIndexedPropertiesTo{External,Pixel}Data |
+ // allows to change elements from arbitrary kind to any |
Igor Sheludko
2014/05/23 12:24:14
nit: please reformat comment
|
+ // ExternalArray elements kind. Satisfy its requirements, checking whether |
+ // we already have the cached transition. |
if (IsExternalArrayElementsKind(to_kind) && |
!IsFixedTypedArrayElementsKind(map->elements_kind())) { |
+ if (map->HasElementsTransition()) { |
+ Map* next_map = map->elements_transition_map(); |
+ if (next_map->elements_kind() == to_kind) return next_map; |
+ } |
return map; |
} |