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

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

Issue 863513002: [turbofan] Rename IrOpcode predicate IsLeafOpcode to IsConstantOpcode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 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/opcodes.h » ('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/compiler/access-builder.h" 5 #include "src/compiler/access-builder.h"
6 #include "src/compiler/graph-inl.h" 6 #include "src/compiler/graph-inl.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/node-aux-data-inl.h" 9 #include "src/compiler/node-aux-data-inl.h"
10 #include "src/compiler/node-matchers.h" 10 #include "src/compiler/node-matchers.h"
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 simplified()->StoreField(AccessBuilder::ForContextSlot(access.index()))); 851 simplified()->StoreField(AccessBuilder::ForContextSlot(access.index())));
852 node->RemoveInput(2); 852 node->RemoveInput(2);
853 DCHECK_EQ(4, node->InputCount()); 853 DCHECK_EQ(4, node->InputCount());
854 return Changed(node); 854 return Changed(node);
855 } 855 }
856 856
857 857
858 Reduction JSTypedLowering::Reduce(Node* node) { 858 Reduction JSTypedLowering::Reduce(Node* node) {
859 // Check if the output type is a singleton. In that case we already know the 859 // Check if the output type is a singleton. In that case we already know the
860 // result value and can simply replace the node if it's eliminable. 860 // result value and can simply replace the node if it's eliminable.
861 if (NodeProperties::IsTyped(node) && 861 if (!IrOpcode::IsConstantOpcode(node->opcode()) &&
862 !IrOpcode::IsLeafOpcode(node->opcode()) && 862 NodeProperties::IsTyped(node) &&
863 node->op()->HasProperty(Operator::kEliminatable)) { 863 node->op()->HasProperty(Operator::kEliminatable)) {
864 Type* upper = NodeProperties::GetBounds(node).upper; 864 Type* upper = NodeProperties::GetBounds(node).upper;
865 if (upper->IsConstant()) { 865 if (upper->IsConstant()) {
866 Node* replacement = jsgraph()->Constant(upper->AsConstant()->Value()); 866 Node* replacement = jsgraph()->Constant(upper->AsConstant()->Value());
867 NodeProperties::ReplaceWithValue(node, replacement); 867 NodeProperties::ReplaceWithValue(node, replacement);
868 return Changed(replacement); 868 return Changed(replacement);
869 } else if (upper->Is(Type::MinusZero())) { 869 } else if (upper->Is(Type::MinusZero())) {
870 Node* replacement = jsgraph()->Constant(factory()->minus_zero_value()); 870 Node* replacement = jsgraph()->Constant(factory()->minus_zero_value());
871 NodeProperties::ReplaceWithValue(node, replacement); 871 NodeProperties::ReplaceWithValue(node, replacement);
872 return Changed(replacement); 872 return Changed(replacement);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 } 1013 }
1014 1014
1015 1015
1016 MachineOperatorBuilder* JSTypedLowering::machine() const { 1016 MachineOperatorBuilder* JSTypedLowering::machine() const {
1017 return jsgraph()->machine(); 1017 return jsgraph()->machine();
1018 } 1018 }
1019 1019
1020 } // namespace compiler 1020 } // namespace compiler
1021 } // namespace internal 1021 } // namespace internal
1022 } // namespace v8 1022 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/compiler/opcodes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698