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

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

Issue 1163963003: [turbofan] Use reference equal to zero instead of a smi check. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 6 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 | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »
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/compiler/access-builder.h" 6 #include "src/compiler/access-builder.h"
7 #include "src/compiler/js-graph.h" 7 #include "src/compiler/js-graph.h"
8 #include "src/compiler/js-typed-lowering.h" 8 #include "src/compiler/js-typed-lowering.h"
9 #include "src/compiler/linkage.h" 9 #include "src/compiler/linkage.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 924 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 // Perform checks whether the fast mode applies, by looking for any extension 935 // Perform checks whether the fast mode applies, by looking for any extension
936 // object which might shadow the optimistic declaration. 936 // object which might shadow the optimistic declaration.
937 uint32_t bitset = access.check_bitset(); 937 uint32_t bitset = access.check_bitset();
938 Node* check_true = control; 938 Node* check_true = control;
939 Node* check_false = graph()->NewNode(common()->Merge(0)); 939 Node* check_false = graph()->NewNode(common()->Merge(0));
940 for (int depth = 0; bitset != 0; bitset >>= 1, depth++) { 940 for (int depth = 0; bitset != 0; bitset >>= 1, depth++) {
941 if ((bitset & 1) == 0) continue; 941 if ((bitset & 1) == 0) continue;
942 Node* load = graph()->NewNode( 942 Node* load = graph()->NewNode(
943 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false), 943 javascript()->LoadContext(depth, Context::EXTENSION_INDEX, false),
944 context, context, effect); 944 context, context, effect);
945 Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), load); 945 Node* check = graph()->NewNode(simplified()->ReferenceEqual(Type::Tagged()),
946 load, jsgraph()->ZeroConstant());
946 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), check, 947 Node* branch = graph()->NewNode(common()->Branch(BranchHint::kTrue), check,
947 check_true); 948 check_true);
948 Node* if_true = graph()->NewNode(common()->IfTrue(), branch); 949 Node* if_true = graph()->NewNode(common()->IfTrue(), branch);
949 Node* if_false = graph()->NewNode(common()->IfFalse(), branch); 950 Node* if_false = graph()->NewNode(common()->IfFalse(), branch);
950 check_false->set_op(common()->Merge(check_false->InputCount() + 1)); 951 check_false->set_op(common()->Merge(check_false->InputCount() + 1));
951 check_false->AppendInput(graph()->zone(), if_false); 952 check_false->AppendInput(graph()->zone(), if_false);
952 check_true = if_true; 953 check_true = if_true;
953 } 954 }
954 955
955 // Fast case, because variable is not shadowed. Perform global object load. 956 // Fast case, because variable is not shadowed. Perform global object load.
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
1540 } 1541 }
1541 1542
1542 1543
1543 MachineOperatorBuilder* JSTypedLowering::machine() const { 1544 MachineOperatorBuilder* JSTypedLowering::machine() const {
1544 return jsgraph()->machine(); 1545 return jsgraph()->machine();
1545 } 1546 }
1546 1547
1547 } // namespace compiler 1548 } // namespace compiler
1548 } // namespace internal 1549 } // namespace internal
1549 } // namespace v8 1550 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/unittests/compiler/js-typed-lowering-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698