Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(273)

Unified Diff: src/objects.cc

Issue 291193011: Check for cached transition to ExternalArray elements kind. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698