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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 // Ensure that {receiver} is a heap object. | 125 // Ensure that {receiver} is a heap object. |
126 Node* receiverissmi_control = nullptr; | 126 Node* receiverissmi_control = nullptr; |
127 Node* receiverissmi_effect = effect; | 127 Node* receiverissmi_effect = effect; |
128 if (receiverissmi_possible) { | 128 if (receiverissmi_possible) { |
129 Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), receiver); | 129 Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), receiver); |
130 Node* branch = graph()->NewNode(common()->Branch(), check, control); | 130 Node* branch = graph()->NewNode(common()->Branch(), check, control); |
131 control = graph()->NewNode(common()->IfFalse(), branch); | 131 control = graph()->NewNode(common()->IfFalse(), branch); |
132 receiverissmi_control = graph()->NewNode(common()->IfTrue(), branch); | 132 receiverissmi_control = graph()->NewNode(common()->IfTrue(), branch); |
133 receiverissmi_effect = effect; | 133 receiverissmi_effect = effect; |
134 } else { | 134 } else if (access_infos.size() != 1 || |
| 135 !access_infos[0].receiver_type()->Is(Type::String())) { |
| 136 // TODO(bmeurer): We omit the Smi check here if we are going to lower to |
| 137 // the CheckString below; make this less horrible and adhoc. |
135 receiver = effect = graph()->NewNode(simplified()->CheckTaggedPointer(), | 138 receiver = effect = graph()->NewNode(simplified()->CheckTaggedPointer(), |
136 receiver, effect, control); | 139 receiver, effect, control); |
137 } | 140 } |
138 | 141 |
139 // Load the {receiver} map. The resulting effect is the dominating effect for | 142 // Load the {receiver} map. The resulting effect is the dominating effect for |
140 // all (polymorphic) branches. | 143 // all (polymorphic) branches. |
141 Node* receiver_map = effect = | 144 Node* receiver_map = effect = |
142 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 145 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
143 receiver, effect, control); | 146 receiver, effect, control); |
144 | 147 |
(...skipping 891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1036 } | 1039 } |
1037 | 1040 |
1038 | 1041 |
1039 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { | 1042 SimplifiedOperatorBuilder* JSNativeContextSpecialization::simplified() const { |
1040 return jsgraph()->simplified(); | 1043 return jsgraph()->simplified(); |
1041 } | 1044 } |
1042 | 1045 |
1043 } // namespace compiler | 1046 } // namespace compiler |
1044 } // namespace internal | 1047 } // namespace internal |
1045 } // namespace v8 | 1048 } // namespace v8 |
OLD | NEW |