Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(49)

Side by Side Diff: src/compiler/js-typed-lowering.cc

Issue 1631583002: [for-in] Further refactorings and unification around for-in. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/compiler/typer.cc » ('j') | src/types.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 2293 matching lines...) Expand 10 before | Expand all | Expand 10 after
2304 // Don't need filtering since expected map still matches that of the 2304 // Don't need filtering since expected map still matches that of the
2305 // {receiver}. 2305 // {receiver}.
2306 etrue0 = effect; 2306 etrue0 = effect;
2307 vtrue0 = key; 2307 vtrue0 = key;
2308 } 2308 }
2309 2309
2310 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0); 2310 Node* if_false0 = graph()->NewNode(common()->IfFalse(), branch0);
2311 Node* efalse0; 2311 Node* efalse0;
2312 Node* vfalse0; 2312 Node* vfalse0;
2313 { 2313 {
2314 // Check if the {cache_type} is zero, which indicates proxy. 2314 // Filter the {key} to check if it's still a valid property of the
2315 Node* check1 = graph()->NewNode(simplified()->ReferenceEqual(Type::Any()), 2315 // {receiver} (does the ToName conversion implicitly).
2316 cache_type, jsgraph()->ZeroConstant()); 2316 vfalse0 = efalse0 = graph()->NewNode(
2317 Node* branch1 = graph()->NewNode(common()->Branch(BranchHint::kFalse), 2317 javascript()->CallRuntime(Runtime::kForInFilter), receiver, key,
2318 check1, if_false0); 2318 context, frame_state, effect, if_false0);
2319 2319 if_false0 = graph()->NewNode(common()->IfSuccess(), vfalse0);
2320 Node* if_true1 = graph()->NewNode(common()->IfTrue(), branch1);
2321 Node* etrue1;
2322 Node* vtrue1;
2323 {
2324 // Don't do filtering for proxies.
2325 etrue1 = effect;
2326 vtrue1 = key;
2327 }
2328
2329 Node* if_false1 = graph()->NewNode(common()->IfFalse(), branch1);
2330 Node* efalse1;
2331 Node* vfalse1;
2332 {
2333 // Filter the {key} to check if it's still a valid property of the
2334 // {receiver} (does the ToName conversion implicitly).
2335 vfalse1 = efalse1 = graph()->NewNode(
2336 javascript()->CallRuntime(Runtime::kForInFilter), receiver, key,
2337 context, frame_state, effect, if_false1);
2338 if_false1 = graph()->NewNode(common()->IfSuccess(), vfalse1);
2339 }
2340
2341 if_false0 = graph()->NewNode(common()->Merge(2), if_true1, if_false1);
2342 efalse0 =
2343 graph()->NewNode(common()->EffectPhi(2), etrue1, efalse1, if_false0);
2344 vfalse0 = graph()->NewNode(common()->Phi(MachineRepresentation::kTagged, 2),
2345 vtrue1, vfalse1, if_false0);
2346 } 2320 }
2347 2321
2348 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0); 2322 control = graph()->NewNode(common()->Merge(2), if_true0, if_false0);
2349 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control); 2323 effect = graph()->NewNode(common()->EffectPhi(2), etrue0, efalse0, control);
2350 ReplaceWithValue(node, node, effect, control); 2324 ReplaceWithValue(node, node, effect, control);
2351 node->ReplaceInput(0, vtrue0); 2325 node->ReplaceInput(0, vtrue0);
2352 node->ReplaceInput(1, vfalse0); 2326 node->ReplaceInput(1, vfalse0);
2353 node->ReplaceInput(2, control); 2327 node->ReplaceInput(2, control);
2354 node->TrimInputCount(3); 2328 node->TrimInputCount(3);
2355 NodeProperties::ChangeOp(node, 2329 NodeProperties::ChangeOp(node,
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after
2697 } 2671 }
2698 2672
2699 2673
2700 CompilationDependencies* JSTypedLowering::dependencies() const { 2674 CompilationDependencies* JSTypedLowering::dependencies() const {
2701 return dependencies_; 2675 return dependencies_;
2702 } 2676 }
2703 2677
2704 } // namespace compiler 2678 } // namespace compiler
2705 } // namespace internal 2679 } // namespace internal
2706 } // namespace v8 2680 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/typer.cc » ('j') | src/types.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698