Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index 1dc170410951f7e01238815dae3b62340e6f6721..1890eb40954d479ec01dd4339a498f13a0f8de02 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -2602,13 +2602,18 @@ MaybeObject* JSObject::GetElementsTransitionMapSlow(ElementsKind to_kind) { |
return start_map->CopyAsElementsKind(to_kind, OMIT_TRANSITION); |
} |
- Map* closest_map = FindClosestElementsTransition(start_map, to_kind); |
+ return start_map->AsElementsKind(to_kind); |
+} |
+ |
- if (closest_map->elements_kind() == to_kind) { |
+MaybeObject* Map::AsElementsKind(ElementsKind kind) { |
+ Map* closest_map = FindClosestElementsTransition(this, kind); |
+ |
+ if (closest_map->elements_kind() == kind) { |
return closest_map; |
} |
- return AddMissingElementsTransitions(closest_map, to_kind); |
+ return AddMissingElementsTransitions(closest_map, kind); |
} |
@@ -3073,6 +3078,13 @@ void JSObject::AddFastPropertyUsingMap(Handle<JSObject> object, |
} |
+void JSObject::TransitionToMap(Handle<JSObject> object, Handle<Map> map) { |
+ CALL_HEAP_FUNCTION_VOID( |
+ object->GetIsolate(), |
+ object->TransitionToMap(*map)); |
+} |
+ |
+ |
MaybeObject* JSObject::SetPropertyForResult(LookupResult* lookup, |
Name* name_raw, |
Object* value_raw, |