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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 for (size_t j = 0; j < access_infos.size(); ++j) { | 150 for (size_t j = 0; j < access_infos.size(); ++j) { |
151 PropertyAccessInfo const& access_info = access_infos[j]; | 151 PropertyAccessInfo const& access_info = access_infos[j]; |
152 Node* this_value = value; | 152 Node* this_value = value; |
153 Node* this_receiver = receiver; | 153 Node* this_receiver = receiver; |
154 Node* this_effect = effect; | 154 Node* this_effect = effect; |
155 Node* this_control; | 155 Node* this_control; |
156 | 156 |
157 // Perform map check on {receiver}. | 157 // Perform map check on {receiver}. |
158 Type* receiver_type = access_info.receiver_type(); | 158 Type* receiver_type = access_info.receiver_type(); |
159 if (receiver_type->Is(Type::String())) { | 159 if (receiver_type->Is(Type::String())) { |
160 // Emit an instance type check for strings. | 160 Node* check = graph()->NewNode(simplified()->ObjectIsString(), receiver); |
161 Node* receiver_instance_type = this_effect = graph()->NewNode( | |
162 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), | |
163 receiver_map, this_effect, fallthrough_control); | |
164 Node* check = | |
165 graph()->NewNode(machine()->Uint32LessThan(), receiver_instance_type, | |
166 jsgraph()->Uint32Constant(FIRST_NONSTRING_TYPE)); | |
167 if (j == access_infos.size() - 1) { | 161 if (j == access_infos.size() - 1) { |
168 this_control = | 162 this_control = |
169 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, | 163 graph()->NewNode(common()->DeoptimizeUnless(), check, frame_state, |
170 this_effect, fallthrough_control); | 164 this_effect, fallthrough_control); |
171 fallthrough_control = nullptr; | 165 fallthrough_control = nullptr; |
172 } else { | 166 } else { |
173 Node* branch = | 167 Node* branch = |
174 graph()->NewNode(common()->Branch(), check, fallthrough_control); | 168 graph()->NewNode(common()->Branch(), check, fallthrough_control); |
175 fallthrough_control = graph()->NewNode(common()->IfFalse(), branch); | 169 fallthrough_control = graph()->NewNode(common()->IfFalse(), branch); |
176 this_control = graph()->NewNode(common()->IfTrue(), branch); | 170 this_control = graph()->NewNode(common()->IfTrue(), branch); |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1034 } | 1028 } |
1035 | 1029 |
1036 | 1030 |
1037 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1031 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1038 return jsgraph()->simplified(); | 1032 return jsgraph()->simplified(); |
1039 } | 1033 } |
1040 | 1034 |
1041 } // namespace compiler | 1035 } // namespace compiler |
1042 } // namespace internal | 1036 } // namespace internal |
1043 } // namespace v8 | 1037 } // namespace v8 |
OLD | NEW |