OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 4077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4088 SmallMapList* maps = prop->GetReceiverTypes(); | 4088 SmallMapList* maps = prop->GetReceiverTypes(); |
4089 bool todo_external_array = false; | 4089 bool todo_external_array = false; |
4090 | 4090 |
4091 static const int kNumElementTypes = kElementsKindCount; | 4091 static const int kNumElementTypes = kElementsKindCount; |
4092 bool type_todo[kNumElementTypes]; | 4092 bool type_todo[kNumElementTypes]; |
4093 for (int i = 0; i < kNumElementTypes; ++i) { | 4093 for (int i = 0; i < kNumElementTypes; ++i) { |
4094 type_todo[i] = false; | 4094 type_todo[i] = false; |
4095 } | 4095 } |
4096 | 4096 |
4097 // Elements_kind transition support. | 4097 // Elements_kind transition support. |
4098 MapList transition_target(maps->length()); | 4098 MapHandleList transition_target(maps->length()); |
4099 // Collect possible transition targets. | 4099 // Collect possible transition targets. |
4100 MapList possible_transitioned_maps(maps->length()); | 4100 MapHandleList possible_transitioned_maps(maps->length()); |
4101 for (int i = 0; i < maps->length(); ++i) { | 4101 for (int i = 0; i < maps->length(); ++i) { |
4102 Handle<Map> map = maps->at(i); | 4102 Handle<Map> map = maps->at(i); |
4103 ElementsKind elements_kind = map->elements_kind(); | 4103 ElementsKind elements_kind = map->elements_kind(); |
4104 if (elements_kind == FAST_DOUBLE_ELEMENTS || | 4104 if (elements_kind == FAST_DOUBLE_ELEMENTS || |
4105 elements_kind == FAST_ELEMENTS) { | 4105 elements_kind == FAST_ELEMENTS) { |
4106 possible_transitioned_maps.Add(*map); | 4106 possible_transitioned_maps.Add(map); |
4107 } | 4107 } |
4108 } | 4108 } |
4109 // Get transition target for each map (NULL == no transition). | 4109 // Get transition target for each map (NULL == no transition). |
4110 for (int i = 0; i < maps->length(); ++i) { | 4110 for (int i = 0; i < maps->length(); ++i) { |
4111 Handle<Map> map = maps->at(i); | 4111 Handle<Map> map = maps->at(i); |
4112 Map* transitioned_map = | 4112 Handle<Map> transitioned_map = |
4113 map->FindTransitionedMap(&possible_transitioned_maps); | 4113 map->FindTransitionedMap(&possible_transitioned_maps); |
4114 transition_target.Add(transitioned_map); | 4114 transition_target.Add(transitioned_map); |
4115 } | 4115 } |
4116 | 4116 |
4117 int num_untransitionable_maps = 0; | 4117 int num_untransitionable_maps = 0; |
4118 Handle<Map> untransitionable_map; | 4118 Handle<Map> untransitionable_map; |
4119 for (int i = 0; i < maps->length(); ++i) { | 4119 for (int i = 0; i < maps->length(); ++i) { |
4120 Handle<Map> map = maps->at(i); | 4120 Handle<Map> map = maps->at(i); |
4121 ASSERT(map->IsMap()); | 4121 ASSERT(map->IsMap()); |
4122 if (transition_target.at(i) != NULL) { | 4122 if (!transition_target.at(i).is_null()) { |
4123 object = AddInstruction(new(zone()) HTransitionElementsKind( | 4123 object = AddInstruction(new(zone()) HTransitionElementsKind( |
4124 object, map, Handle<Map>(transition_target.at(i)))); | 4124 object, map, transition_target.at(i))); |
4125 } else { | 4125 } else { |
4126 type_todo[map->elements_kind()] = true; | 4126 type_todo[map->elements_kind()] = true; |
4127 if (map->elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND) { | 4127 if (map->elements_kind() >= FIRST_EXTERNAL_ARRAY_ELEMENTS_KIND) { |
4128 todo_external_array = true; | 4128 todo_external_array = true; |
4129 } | 4129 } |
4130 num_untransitionable_maps++; | 4130 num_untransitionable_maps++; |
4131 untransitionable_map = map; | 4131 untransitionable_map = map; |
4132 } | 4132 } |
4133 } | 4133 } |
4134 | 4134 |
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7013 } | 7013 } |
7014 } | 7014 } |
7015 | 7015 |
7016 #ifdef DEBUG | 7016 #ifdef DEBUG |
7017 if (graph_ != NULL) graph_->Verify(false); // No full verify. | 7017 if (graph_ != NULL) graph_->Verify(false); // No full verify. |
7018 if (allocator_ != NULL) allocator_->Verify(); | 7018 if (allocator_ != NULL) allocator_->Verify(); |
7019 #endif | 7019 #endif |
7020 } | 7020 } |
7021 | 7021 |
7022 } } // namespace v8::internal | 7022 } } // namespace v8::internal |
OLD | NEW |