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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 871373010: [turbofan] Only replace nodes eagerly during simplified lowering if the types stay the same. (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 | test/mjsunit/compiler/regress-452427.js » ('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/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/base/bits.h" 9 #include "src/base/bits.h"
10 #include "src/code-factory.h" 10 #include "src/code-factory.h"
(...skipping 1014 matching lines...) Expand 10 before | Expand all | Expand 10 after
1025 break; 1025 break;
1026 } 1026 }
1027 } 1027 }
1028 1028
1029 void DeferReplacement(Node* node, Node* replacement) { 1029 void DeferReplacement(Node* node, Node* replacement) {
1030 if (FLAG_trace_representation) { 1030 if (FLAG_trace_representation) {
1031 TRACE(("defer replacement #%d:%s with #%d:%s\n", node->id(), 1031 TRACE(("defer replacement #%d:%s with #%d:%s\n", node->id(),
1032 node->op()->mnemonic(), replacement->id(), 1032 node->op()->mnemonic(), replacement->id(),
1033 replacement->op()->mnemonic())); 1033 replacement->op()->mnemonic()));
1034 } 1034 }
1035 if (replacement->id() < count_) { 1035 if (replacement->id() < count_ &&
1036 // Replace with a previously existing node eagerly. 1036 GetInfo(replacement)->output == GetInfo(node)->output) {
1037 // Replace with a previously existing node eagerly only if the type is the
1038 // same.
1037 node->ReplaceUses(replacement); 1039 node->ReplaceUses(replacement);
1038 } else { 1040 } else {
1039 // Otherwise, we are replacing a node with a representation change. 1041 // Otherwise, we are replacing a node with a representation change.
1040 // Such a substitution must be done after all lowering is done, because 1042 // Such a substitution must be done after all lowering is done, because
1041 // new nodes do not have {NodeInfo} entries, and that would confuse 1043 // changing the type could confuse the representation change
1042 // the representation change insertion for uses of it. 1044 // insertion for uses of the node.
1043 replacements_.push_back(node); 1045 replacements_.push_back(node);
1044 replacements_.push_back(replacement); 1046 replacements_.push_back(replacement);
1045 } 1047 }
1046 // TODO(titzer) node->RemoveAllInputs(); // Node is now dead. 1048 // TODO(titzer) node->RemoveAllInputs(); // Node is now dead.
1047 } 1049 }
1048 1050
1049 void PrintUseInfo(Node* node) { 1051 void PrintUseInfo(Node* node) {
1050 TRACE(("#%d:%-20s ", node->id(), node->op()->mnemonic())); 1052 TRACE(("#%d:%-20s ", node->id(), node->op()->mnemonic()));
1051 PrintInfo(GetUseInfo(node)); 1053 PrintInfo(GetUseInfo(node));
1052 TRACE(("\n")); 1054 TRACE(("\n"));
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1511 1513
1512 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) { 1514 void SimplifiedLowering::DoStringLessThanOrEqual(Node* node) {
1513 node->set_op(machine()->IntLessThanOrEqual()); 1515 node->set_op(machine()->IntLessThanOrEqual());
1514 node->ReplaceInput(0, StringComparison(node, true)); 1516 node->ReplaceInput(0, StringComparison(node, true));
1515 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL)); 1517 node->ReplaceInput(1, jsgraph()->SmiConstant(EQUAL));
1516 } 1518 }
1517 1519
1518 } // namespace compiler 1520 } // namespace compiler
1519 } // namespace internal 1521 } // namespace internal
1520 } // namespace v8 1522 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/regress-452427.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698