ElementsKind transitioning support for keyed loads in Crankshaft

Review URL: http://codereview.chromium.org/8352012

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9713 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent deff312f
......@@ -4096,33 +4096,30 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
// Elements_kind transition support.
MapList transition_target(maps->length());
if (is_store) {
// Collect possible transition targets.
MapList possible_transitioned_maps(maps->length());
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
ElementsKind elements_kind = map->elements_kind();
if (elements_kind == FAST_DOUBLE_ELEMENTS ||
elements_kind == FAST_ELEMENTS) {
possible_transitioned_maps.Add(*map);
}
}
// Get transition target for each map (NULL == no transition).
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
Map* transitioned_map =
map->FindTransitionedMap(&possible_transitioned_maps);
transition_target.Add(transitioned_map);
// Collect possible transition targets.
MapList possible_transitioned_maps(maps->length());
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
ElementsKind elements_kind = map->elements_kind();
if (elements_kind == FAST_DOUBLE_ELEMENTS ||
elements_kind == FAST_ELEMENTS) {
possible_transitioned_maps.Add(*map);
}
}
// Get transition target for each map (NULL == no transition).
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
Map* transitioned_map =
map->FindTransitionedMap(&possible_transitioned_maps);
transition_target.Add(transitioned_map);
}
int num_untransitionable_maps = 0;
Handle<Map> untransitionable_map;
for (int i = 0; i < maps->length(); ++i) {
Handle<Map> map = maps->at(i);
ASSERT(map->IsMap());
ASSERT(!is_store || (transition_target.length() == maps->length()));
if (is_store && transition_target.at(i) != NULL) {
if (transition_target.at(i) != NULL) {
object = AddInstruction(new(zone()) HTransitionElementsKind(
object, map, Handle<Map>(transition_target.at(i))));
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment