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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 for (size_t j = 0; j < access_infos.size(); ++j) { | 147 for (size_t j = 0; j < access_infos.size(); ++j) { |
148 PropertyAccessInfo const& access_info = access_infos[j]; | 148 PropertyAccessInfo const& access_info = access_infos[j]; |
149 Node* this_value = value; | 149 Node* this_value = value; |
150 Node* this_receiver = receiver; | 150 Node* this_receiver = receiver; |
151 Node* this_effect = effect; | 151 Node* this_effect = effect; |
152 Node* this_control; | 152 Node* this_control; |
153 | 153 |
154 // Perform map check on {receiver}. | 154 // Perform map check on {receiver}. |
155 Type* receiver_type = access_info.receiver_type(); | 155 Type* receiver_type = access_info.receiver_type(); |
156 if (receiver_type->Is(Type::String())) { | 156 if (receiver_type->Is(Type::String())) { |
157 Node* check = graph()->NewNode(simplified()->ObjectIsString(), receiver); | |
158 if (j == access_infos.size() - 1) { | 157 if (j == access_infos.size() - 1) { |
159 this_effect = graph()->NewNode(simplified()->CheckIf(), check, | 158 this_receiver = this_effect = |
160 this_effect, fallthrough_control); | 159 graph()->NewNode(simplified()->CheckString(), receiver, this_effect, |
| 160 fallthrough_control); |
161 this_control = fallthrough_control; | 161 this_control = fallthrough_control; |
162 fallthrough_control = nullptr; | 162 fallthrough_control = nullptr; |
163 } else { | 163 } else { |
| 164 Node* check = |
| 165 graph()->NewNode(simplified()->ObjectIsString(), receiver); |
164 Node* branch = | 166 Node* branch = |
165 graph()->NewNode(common()->Branch(), check, fallthrough_control); | 167 graph()->NewNode(common()->Branch(), check, fallthrough_control); |
166 fallthrough_control = graph()->NewNode(common()->IfFalse(), branch); | 168 fallthrough_control = graph()->NewNode(common()->IfFalse(), branch); |
167 this_control = graph()->NewNode(common()->IfTrue(), branch); | 169 this_control = graph()->NewNode(common()->IfTrue(), branch); |
168 } | 170 } |
169 } else { | 171 } else { |
170 // Emit a (sequence of) map checks for other {receiver}s. | 172 // Emit a (sequence of) map checks for other {receiver}s. |
171 ZoneVector<Node*> this_controls(zone()); | 173 ZoneVector<Node*> this_controls(zone()); |
172 ZoneVector<Node*> this_effects(zone()); | 174 ZoneVector<Node*> this_effects(zone()); |
173 int num_classes = access_info.receiver_type()->NumClasses(); | 175 int num_classes = access_info.receiver_type()->NumClasses(); |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 } | 1036 } |
1035 | 1037 |
1036 | 1038 |
1037 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1039 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1038 return jsgraph()->simplified(); | 1040 return jsgraph()->simplified(); |
1039 } | 1041 } |
1040 | 1042 |
1041 } // namespace compiler | 1043 } // namespace compiler |
1042 } // namespace internal | 1044 } // namespace internal |
1043 } // namespace v8 | 1045 } // namespace v8 |
OLD | NEW |