| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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/compiler/js-native-context-specialization.h" | 5 #include "src/compiler/js-native-context-specialization.h" |
| 6 | 6 |
| 7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/compilation-dependencies.h" | 9 #include "src/compilation-dependencies.h" |
| 10 #include "src/compiler/access-builder.h" | 10 #include "src/compiler/access-builder.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 // Compute property access infos for the receiver maps. | 91 // Compute property access infos for the receiver maps. |
| 92 AccessInfoFactory access_info_factory(dependencies(), native_context, | 92 AccessInfoFactory access_info_factory(dependencies(), native_context, |
| 93 graph()->zone()); | 93 graph()->zone()); |
| 94 ZoneVector<PropertyAccessInfo> access_infos(zone()); | 94 ZoneVector<PropertyAccessInfo> access_infos(zone()); |
| 95 if (!access_info_factory.ComputePropertyAccessInfos( | 95 if (!access_info_factory.ComputePropertyAccessInfos( |
| 96 receiver_maps, name, access_mode, &access_infos)) { | 96 receiver_maps, name, access_mode, &access_infos)) { |
| 97 return NoChange(); | 97 return NoChange(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 // Nothing to do if we have no non-deprecated maps. | 100 // Nothing to do if we have no non-deprecated maps. |
| 101 if (access_infos.empty()) return NoChange(); | 101 if (access_infos.empty()) { |
| 102 return ReduceSoftDeoptimize( |
| 103 node, DeoptimizeReason::kInsufficientTypeFeedbackForGenericNamedAccess); |
| 104 } |
| 102 | 105 |
| 103 // The final states for every polymorphic branch. We join them with | 106 // The final states for every polymorphic branch. We join them with |
| 104 // Merge++Phi+EffectPhi at the bottom. | 107 // Merge++Phi+EffectPhi at the bottom. |
| 105 ZoneVector<Node*> values(zone()); | 108 ZoneVector<Node*> values(zone()); |
| 106 ZoneVector<Node*> effects(zone()); | 109 ZoneVector<Node*> effects(zone()); |
| 107 ZoneVector<Node*> controls(zone()); | 110 ZoneVector<Node*> controls(zone()); |
| 108 | 111 |
| 109 // Ensure that {index} matches the specified {name} (if {index} is given). | 112 // Ensure that {index} matches the specified {name} (if {index} is given). |
| 110 if (index != nullptr) { | 113 if (index != nullptr) { |
| 111 Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Name()), | 114 Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Name()), |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 // Compute element access infos for the receiver maps. | 513 // Compute element access infos for the receiver maps. |
| 511 AccessInfoFactory access_info_factory(dependencies(), native_context, | 514 AccessInfoFactory access_info_factory(dependencies(), native_context, |
| 512 graph()->zone()); | 515 graph()->zone()); |
| 513 ZoneVector<ElementAccessInfo> access_infos(zone()); | 516 ZoneVector<ElementAccessInfo> access_infos(zone()); |
| 514 if (!access_info_factory.ComputeElementAccessInfos(receiver_maps, access_mode, | 517 if (!access_info_factory.ComputeElementAccessInfos(receiver_maps, access_mode, |
| 515 &access_infos)) { | 518 &access_infos)) { |
| 516 return NoChange(); | 519 return NoChange(); |
| 517 } | 520 } |
| 518 | 521 |
| 519 // Nothing to do if we have no non-deprecated maps. | 522 // Nothing to do if we have no non-deprecated maps. |
| 520 if (access_infos.empty()) return NoChange(); | 523 if (access_infos.empty()) { |
| 524 return ReduceSoftDeoptimize( |
| 525 node, DeoptimizeReason::kInsufficientTypeFeedbackForGenericKeyedAccess); |
| 526 } |
| 521 | 527 |
| 522 // The final states for every polymorphic branch. We join them with | 528 // The final states for every polymorphic branch. We join them with |
| 523 // Merge+Phi+EffectPhi at the bottom. | 529 // Merge+Phi+EffectPhi at the bottom. |
| 524 ZoneVector<Node*> values(zone()); | 530 ZoneVector<Node*> values(zone()); |
| 525 ZoneVector<Node*> effects(zone()); | 531 ZoneVector<Node*> effects(zone()); |
| 526 ZoneVector<Node*> controls(zone()); | 532 ZoneVector<Node*> controls(zone()); |
| 527 | 533 |
| 528 // Ensure that {receiver} is a heap object. | 534 // Ensure that {receiver} is a heap object. |
| 529 receiver = effect = graph()->NewNode(simplified()->CheckTaggedPointer(), | 535 receiver = effect = graph()->NewNode(simplified()->CheckTaggedPointer(), |
| 530 receiver, effect, control); | 536 receiver, effect, control); |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1039 } | 1045 } |
| 1040 | 1046 |
| 1041 | 1047 |
| 1042 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1048 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
| 1043 return jsgraph()->simplified(); | 1049 return jsgraph()->simplified(); |
| 1044 } | 1050 } |
| 1045 | 1051 |
| 1046 } // namespace compiler | 1052 } // namespace compiler |
| 1047 } // namespace internal | 1053 } // namespace internal |
| 1048 } // namespace v8 | 1054 } // namespace v8 |
| OLD | NEW |