OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/compilation-dependencies.h" | 6 #include "src/compilation-dependencies.h" |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/js-typed-lowering.h" | 9 #include "src/compiler/js-typed-lowering.h" |
10 #include "src/compiler/linkage.h" | 10 #include "src/compiler/linkage.h" |
(...skipping 2205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2216 cache_type_true0 = cache_type; | 2216 cache_type_true0 = cache_type; |
2217 } | 2217 } |
2218 | 2218 |
2219 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); | 2219 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); |
2220 Node* cache_array_false0; | 2220 Node* cache_array_false0; |
2221 Node* cache_length_false0; | 2221 Node* cache_length_false0; |
2222 Node* cache_type_false0; | 2222 Node* cache_type_false0; |
2223 Node* efalse0; | 2223 Node* efalse0; |
2224 { | 2224 { |
2225 // FixedArray case. | 2225 // FixedArray case. |
2226 Node* receiver_instance_type = efalse0 = graph()->NewNode( | 2226 cache_type_false0 = jsgraph()->OneConstant(); // Smi means slow check |
2227 simplified()->LoadField(AccessBuilder::ForMapInstanceType()), | |
2228 receiver_map, effect, if_false0); | |
2229 | |
2230 cache_type_false0 = graph()->NewNode( | |
2231 common()->Select(MachineRepresentation::kTagged, BranchHint::kFalse), | |
2232 graph()->NewNode(machine()->Word32Equal(), receiver_instance_type, | |
2233 jsgraph()->Uint32Constant(JS_PROXY_TYPE)), | |
2234 jsgraph()->ZeroConstant(), // Zero indicagtes proxy. | |
2235 jsgraph()->OneConstant()); // One means slow check. | |
2236 | |
2237 cache_array_false0 = cache_type; | 2227 cache_array_false0 = cache_type; |
2238 cache_length_false0 = efalse0 = graph()->NewNode( | 2228 cache_length_false0 = efalse0 = graph()->NewNode( |
2239 simplified()->LoadField(AccessBuilder::ForFixedArrayLength()), | 2229 simplified()->LoadField(AccessBuilder::ForFixedArrayLength()), |
2240 cache_array_false0, efalse0, if_false0); | 2230 cache_array_false0, effect, if_false0); |
2241 } | 2231 } |
2242 | 2232 |
2243 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); | 2233 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); |
2244 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); | 2234 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); |
2245 Node* cache_array = | 2235 Node* cache_array = |
2246 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), | 2236 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
2247 cache_array_true0, cache_array_false0, control); | 2237 cache_array_true0, cache_array_false0, control); |
2248 Node* cache_length = | 2238 Node* cache_length = |
2249 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), | 2239 graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
2250 cache_length_true0, cache_length_false0, control); | 2240 cache_length_true0, cache_length_false0, control); |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2689 } | 2679 } |
2690 | 2680 |
2691 | 2681 |
2692 CompilationDependencies* JSTypedLowering::dependencies() const { | 2682 CompilationDependencies* JSTypedLowering::dependencies() const { |
2693 return dependencies_; | 2683 return dependencies_; |
2694 } | 2684 } |
2695 | 2685 |
2696 } // namespace compiler | 2686 } // namespace compiler |
2697 } // namespace internal | 2687 } // namespace internal |
2698 } // namespace v8 | 2688 } // namespace v8 |
OLD | NEW |