| 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 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 | 1214 |
| 1215 | 1215 |
| 1216 Node* runtime_has_in_proto_chain = control = graph()->NewNode( | 1216 Node* runtime_has_in_proto_chain = control = graph()->NewNode( |
| 1217 common()->Merge(2), if_is_access_check_needed, if_is_proxy); | 1217 common()->Merge(2), if_is_access_check_needed, if_is_proxy); |
| 1218 effect = graph()->NewNode(common()->EffectPhi(2), e_is_access_check_needed, | 1218 effect = graph()->NewNode(common()->EffectPhi(2), e_is_access_check_needed, |
| 1219 e_is_proxy, control); | 1219 e_is_proxy, control); |
| 1220 | 1220 |
| 1221 // If we need an access check or the object is a Proxy, make a runtime call | 1221 // If we need an access check or the object is a Proxy, make a runtime call |
| 1222 // to finish the lowering. | 1222 // to finish the lowering. |
| 1223 Node* bool_result_runtime_has_in_proto_chain_case = graph()->NewNode( | 1223 Node* bool_result_runtime_has_in_proto_chain_case = graph()->NewNode( |
| 1224 javascript()->CallRuntime(Runtime::kHasInPrototypeChain, 2), r.left(), | 1224 javascript()->CallRuntime(Runtime::kHasInPrototypeChain), r.left(), |
| 1225 prototype, context, frame_state, effect, control); | 1225 prototype, context, frame_state, effect, control); |
| 1226 | 1226 |
| 1227 control = graph()->NewNode(common()->IfFalse(), branch_is_proxy); | 1227 control = graph()->NewNode(common()->IfFalse(), branch_is_proxy); |
| 1228 | 1228 |
| 1229 Node* object_prototype = effect = graph()->NewNode( | 1229 Node* object_prototype = effect = graph()->NewNode( |
| 1230 simplified()->LoadField(AccessBuilder::ForMapPrototype()), | 1230 simplified()->LoadField(AccessBuilder::ForMapPrototype()), |
| 1231 loop_object_map, loop_effect, control); | 1231 loop_object_map, loop_effect, control); |
| 1232 | 1232 |
| 1233 // Check if object prototype is equal to function prototype. | 1233 // Check if object prototype is equal to function prototype. |
| 1234 Node* eq_proto = | 1234 Node* eq_proto = |
| (...skipping 1038 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2273 Reduction JSTypedLowering::ReduceJSForInPrepare(Node* node) { | 2273 Reduction JSTypedLowering::ReduceJSForInPrepare(Node* node) { |
| 2274 DCHECK_EQ(IrOpcode::kJSForInPrepare, node->opcode()); | 2274 DCHECK_EQ(IrOpcode::kJSForInPrepare, node->opcode()); |
| 2275 Node* receiver = NodeProperties::GetValueInput(node, 0); | 2275 Node* receiver = NodeProperties::GetValueInput(node, 0); |
| 2276 Node* context = NodeProperties::GetContextInput(node); | 2276 Node* context = NodeProperties::GetContextInput(node); |
| 2277 Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); | 2277 Node* frame_state = NodeProperties::GetFrameStateInput(node, 0); |
| 2278 Node* effect = NodeProperties::GetEffectInput(node); | 2278 Node* effect = NodeProperties::GetEffectInput(node); |
| 2279 Node* control = NodeProperties::GetControlInput(node); | 2279 Node* control = NodeProperties::GetControlInput(node); |
| 2280 | 2280 |
| 2281 // Get the set of properties to enumerate. | 2281 // Get the set of properties to enumerate. |
| 2282 Node* cache_type = effect = graph()->NewNode( | 2282 Node* cache_type = effect = graph()->NewNode( |
| 2283 javascript()->CallRuntime(Runtime::kGetPropertyNamesFast, 1), receiver, | 2283 javascript()->CallRuntime(Runtime::kGetPropertyNamesFast), receiver, |
| 2284 context, frame_state, effect, control); | 2284 context, frame_state, effect, control); |
| 2285 control = graph()->NewNode(common()->IfSuccess(), cache_type); | 2285 control = graph()->NewNode(common()->IfSuccess(), cache_type); |
| 2286 | 2286 |
| 2287 Node* receiver_map = effect = | 2287 Node* receiver_map = effect = |
| 2288 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 2288 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
| 2289 receiver, effect, control); | 2289 receiver, effect, control); |
| 2290 Node* cache_type_map = effect = | 2290 Node* cache_type_map = effect = |
| 2291 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), | 2291 graph()->NewNode(simplified()->LoadField(AccessBuilder::ForMap()), |
| 2292 cache_type, effect, control); | 2292 cache_type, effect, control); |
| 2293 Node* meta_map = jsgraph()->HeapConstant(factory()->meta_map()); | 2293 Node* meta_map = jsgraph()->HeapConstant(factory()->meta_map()); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2479 vtrue1 = key; | 2479 vtrue1 = key; |
| 2480 } | 2480 } |
| 2481 | 2481 |
| 2482 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); | 2482 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1); |
| 2483 Node* efalse1; | 2483 Node* efalse1; |
| 2484 Node* vfalse1; | 2484 Node* vfalse1; |
| 2485 { | 2485 { |
| 2486 // Filter the {key} to check if it's still a valid property of the | 2486 // Filter the {key} to check if it's still a valid property of the |
| 2487 // {receiver} (does the ToName conversion implicitly). | 2487 // {receiver} (does the ToName conversion implicitly). |
| 2488 vfalse1 = efalse1 = graph()->NewNode( | 2488 vfalse1 = efalse1 = graph()->NewNode( |
| 2489 javascript()->CallRuntime(Runtime::kForInFilter, 2), receiver, key, | 2489 javascript()->CallRuntime(Runtime::kForInFilter), receiver, key, |
| 2490 context, frame_state, effect, if_false1); | 2490 context, frame_state, effect, if_false1); |
| 2491 if_false1 = graph()->NewNode(common()->IfSuccess(), vfalse1); | 2491 if_false1 = graph()->NewNode(common()->IfSuccess(), vfalse1); |
| 2492 } | 2492 } |
| 2493 | 2493 |
| 2494 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); | 2494 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1); |
| 2495 efalse0 = | 2495 efalse0 = |
| 2496 graph()->NewNode(common()->EffectPhi(2), etrue1, efalse1, if_false0); | 2496 graph()->NewNode(common()->EffectPhi(2), etrue1, efalse1, if_false0); |
| 2497 vfalse0 = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), | 2497 vfalse0 = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2), |
| 2498 vtrue1, vfalse1, if_false0); | 2498 vtrue1, vfalse1, if_false0); |
| 2499 } | 2499 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2852 } | 2852 } |
| 2853 | 2853 |
| 2854 | 2854 |
| 2855 CompilationDependencies* JSTypedLowering::dependencies() const { | 2855 CompilationDependencies* JSTypedLowering::dependencies() const { |
| 2856 return dependencies_; | 2856 return dependencies_; |
| 2857 } | 2857 } |
| 2858 | 2858 |
| 2859 } // namespace compiler | 2859 } // namespace compiler |
| 2860 } // namespace internal | 2860 } // namespace internal |
| 2861 } // namespace v8 | 2861 } // namespace v8 |
| OLD | NEW |