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
This commit is contained in:
parent
deff312f25
commit
655b2332d7
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user