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

Unified Diff: src/objects.cc

Issue 11365174: A change in the way we place TransitionElementKinds in the tree. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Now includes optimization of codegen for transition elementskind instruction Created 8 years 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 | « src/objects.h ('k') | src/runtime.h » ('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 fcc2efad31d96ab969a026f885c6bdaf7dbc64d9..da475d9ed7ba3838e14735818caa615c66179e7f 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -2331,7 +2331,7 @@ Handle<Map> Map::FindTransitionedMap(MapHandleList* candidates) {
}
-static Map* FindClosestElementsTransition(Map* map, ElementsKind to_kind) {
+Map* FindClosestElementsTransition(Map* map, ElementsKind to_kind) {
Map* current_map = map;
int index = GetSequenceIndexFromFastElementsKind(map->elements_kind());
int to_index = IsFastElementsKind(to_kind)
@@ -2362,17 +2362,16 @@ Map* Map::LookupElementsTransitionMap(ElementsKind to_kind) {
}
-static MaybeObject* AddMissingElementsTransitions(Map* map,
- ElementsKind to_kind) {
- ASSERT(IsFastElementsKind(map->elements_kind()));
- int index = GetSequenceIndexFromFastElementsKind(map->elements_kind());
+MaybeObject* Map::AddMissingElementsTransitions(ElementsKind to_kind) {
+ ASSERT(IsFastElementsKind(elements_kind()));
+ int index = GetSequenceIndexFromFastElementsKind(elements_kind());
int to_index = IsFastElementsKind(to_kind)
? GetSequenceIndexFromFastElementsKind(to_kind)
: GetSequenceIndexFromFastElementsKind(TERMINAL_FAST_ELEMENTS_KIND);
ASSERT(index <= to_index);
- Map* current_map = map;
+ Map* current_map = this;
for (; index < to_index; ++index) {
ElementsKind next_kind = GetFastElementsKindFromSequenceIndex(index + 1);
@@ -2436,7 +2435,7 @@ MaybeObject* JSObject::GetElementsTransitionMapSlow(ElementsKind to_kind) {
return closest_map;
}
- return AddMissingElementsTransitions(closest_map, to_kind);
+ return closest_map->AddMissingElementsTransitions(to_kind);
}
« no previous file with comments | « src/objects.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698