OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/hydrogen.h" | 5 #include "src/hydrogen.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "src/v8.h" | 9 #include "src/v8.h" |
10 | 10 |
(...skipping 7156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7167 } | 7167 } |
7168 } | 7168 } |
7169 | 7169 |
7170 DCHECK(!expr->IsPropertyName()); | 7170 DCHECK(!expr->IsPropertyName()); |
7171 HInstruction* instr = NULL; | 7171 HInstruction* instr = NULL; |
7172 | 7172 |
7173 SmallMapList* types; | 7173 SmallMapList* types; |
7174 bool monomorphic = ComputeReceiverTypes(expr, obj, &types, zone()); | 7174 bool monomorphic = ComputeReceiverTypes(expr, obj, &types, zone()); |
7175 | 7175 |
7176 bool force_generic = false; | 7176 bool force_generic = false; |
7177 if (access_type == STORE && | 7177 if (access_type == STORE && expr->GetKeyType() == PROPERTY) { |
7178 (monomorphic || (types != NULL && !types->is_empty()))) { | 7178 // Non-Generic accesses assume that elements are being accessed, and will |
| 7179 // deopt for non-index keys, which the IC knows will occur. |
| 7180 // TODO(jkummerow): Consider adding proper support for property accesses. |
| 7181 force_generic = true; |
| 7182 monomorphic = false; |
| 7183 } else if (access_type == STORE && |
| 7184 (monomorphic || (types != NULL && !types->is_empty()))) { |
7179 // Stores can't be mono/polymorphic if their prototype chain has dictionary | 7185 // Stores can't be mono/polymorphic if their prototype chain has dictionary |
7180 // elements. However a receiver map that has dictionary elements itself | 7186 // elements. However a receiver map that has dictionary elements itself |
7181 // should be left to normal mono/poly behavior (the other maps may benefit | 7187 // should be left to normal mono/poly behavior (the other maps may benefit |
7182 // from highly optimized stores). | 7188 // from highly optimized stores). |
7183 for (int i = 0; i < types->length(); i++) { | 7189 for (int i = 0; i < types->length(); i++) { |
7184 Handle<Map> current_map = types->at(i); | 7190 Handle<Map> current_map = types->at(i); |
7185 if (current_map->DictionaryElementsInPrototypeChainOnly()) { | 7191 if (current_map->DictionaryElementsInPrototypeChainOnly()) { |
7186 force_generic = true; | 7192 force_generic = true; |
7187 monomorphic = false; | 7193 monomorphic = false; |
7188 break; | 7194 break; |
(...skipping 5344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
12533 if (ShouldProduceTraceOutput()) { | 12539 if (ShouldProduceTraceOutput()) { |
12534 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); | 12540 isolate()->GetHTracer()->TraceHydrogen(name(), graph_); |
12535 } | 12541 } |
12536 | 12542 |
12537 #ifdef DEBUG | 12543 #ifdef DEBUG |
12538 graph_->Verify(false); // No full verify. | 12544 graph_->Verify(false); // No full verify. |
12539 #endif | 12545 #endif |
12540 } | 12546 } |
12541 | 12547 |
12542 } } // namespace v8::internal | 12548 } } // namespace v8::internal |
OLD | NEW |