diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2014-05-23 14:01:17 +0000 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-09-09 16:52:45 -0700 |
commit | 8d9493c315aad5487b5e2a0e48c33ceefb590f2e (patch) | |
tree | 00ac1963dd91ed5a9fd7ed78e274ca382db8638f /deps/v8/src/objects.cc | |
parent | b8a8e5558d74333e141e3a72730eb72c3463c3ef (diff) | |
download | node-8d9493c315aad5487b5e2a0e48c33ceefb590f2e.tar.gz |
deps: cherry-pick r21466 from v8 trunk
Check for cached transition to ExternalArray elements kind.
See [1] and [2] for details.
[1] https://code.google.com/p/v8/issues/detail?id=3337
[2] https://codereview.chromium.org/291193011
Signed-off-by: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'deps/v8/src/objects.cc')
-rw-r--r-- | deps/v8/src/objects.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/deps/v8/src/objects.cc b/deps/v8/src/objects.cc index 8ffd462db..ec569d141 100644 --- a/deps/v8/src/objects.cc +++ b/deps/v8/src/objects.cc @@ -3373,9 +3373,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 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; } |