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/compiler/js-typed-lowering.h" | 5 #include "src/compiler/js-typed-lowering.h" |
6 | 6 |
7 #include "src/ast/modules.h" | 7 #include "src/ast/modules.h" |
8 #include "src/builtins/builtins-utils.h" | 8 #include "src/builtins/builtins-utils.h" |
9 #include "src/code-factory.h" | 9 #include "src/code-factory.h" |
10 #include "src/compilation-dependencies.h" | 10 #include "src/compilation-dependencies.h" |
(...skipping 2181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2192 { | 2192 { |
2193 // Filter the {key} to check if it's still a valid property of the | 2193 // Filter the {key} to check if it's still a valid property of the |
2194 // {receiver} (does the ToName conversion implicitly). | 2194 // {receiver} (does the ToName conversion implicitly). |
2195 Callable const callable = CodeFactory::ForInFilter(isolate()); | 2195 Callable const callable = CodeFactory::ForInFilter(isolate()); |
2196 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( | 2196 CallDescriptor const* const desc = Linkage::GetStubCallDescriptor( |
2197 isolate(), graph()->zone(), callable.descriptor(), 0, | 2197 isolate(), graph()->zone(), callable.descriptor(), 0, |
2198 CallDescriptor::kNeedsFrameState); | 2198 CallDescriptor::kNeedsFrameState); |
2199 vfalse0 = efalse0 = if_false0 = graph()->NewNode( | 2199 vfalse0 = efalse0 = if_false0 = graph()->NewNode( |
2200 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), key, | 2200 common()->Call(desc), jsgraph()->HeapConstant(callable.code()), key, |
2201 receiver, context, frame_state, effect, if_false0); | 2201 receiver, context, frame_state, effect, if_false0); |
| 2202 |
| 2203 // Update potential {IfException} uses of {node} to point to the ahove |
| 2204 // ForInFilter stub call node instead. |
| 2205 Node* if_exception = nullptr; |
| 2206 if (NodeProperties::IsExceptionalCall(node, &if_exception)) { |
| 2207 if_false0 = graph()->NewNode(common()->IfSuccess(), vfalse0); |
| 2208 NodeProperties::ReplaceControlInput(if_exception, vfalse0); |
| 2209 NodeProperties::ReplaceEffectInput(if_exception, efalse0); |
| 2210 Revisit(if_exception); |
| 2211 } |
2202 } | 2212 } |
2203 | 2213 |
2204 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); | 2214 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); |
2205 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); | 2215 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); |
2206 ReplaceWithValue(node, node, effect, control); | 2216 ReplaceWithValue(node, node, effect, control); |
| 2217 |
| 2218 // Morph the {node} into a Phi. |
2207 node->ReplaceInput(0, vtrue0); | 2219 node->ReplaceInput(0, vtrue0); |
2208 node->ReplaceInput(1, vfalse0); | 2220 node->ReplaceInput(1, vfalse0); |
2209 node->ReplaceInput(2, control); | 2221 node->ReplaceInput(2, control); |
2210 node->TrimInputCount(3); | 2222 node->TrimInputCount(3); |
2211 NodeProperties::ChangeOp(node, | 2223 NodeProperties::ChangeOp(node, |
2212 common()->Phi(MachineRepresentation::kTagged, 2)); | 2224 common()->Phi(MachineRepresentation::kTagged, 2)); |
2213 return Changed(node); | 2225 return Changed(node); |
2214 } | 2226 } |
2215 | 2227 |
2216 Reduction JSTypedLowering::ReduceJSLoadMessage(Node* node) { | 2228 Reduction JSTypedLowering::ReduceJSLoadMessage(Node* node) { |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2436 } | 2448 } |
2437 | 2449 |
2438 | 2450 |
2439 CompilationDependencies* JSTypedLowering::dependencies() const { | 2451 CompilationDependencies* JSTypedLowering::dependencies() const { |
2440 return dependencies_; | 2452 return dependencies_; |
2441 } | 2453 } |
2442 | 2454 |
2443 } // namespace compiler | 2455 } // namespace compiler |
2444 } // namespace internal | 2456 } // namespace internal |
2445 } // namespace v8 | 2457 } // namespace v8 |
OLD | NEW |