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

Side by Side Diff: src/compiler/node.cc

Issue 1132353004: [turbofan] Fix Node::TrimInputCount() followed by Node::AppendInput() bug. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Update comments. Created 5 years, 7 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 | « src/compiler/node.h ('k') | test/unittests/compiler/node-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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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/node.h" 5 #include "src/compiler/node.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 for (Edge edge : input_edges()) edge.UpdateTo(nullptr); 93 for (Edge edge : input_edges()) edge.UpdateTo(nullptr);
94 } 94 }
95 95
96 96
97 void Node::TrimInputCount(int new_input_count) { 97 void Node::TrimInputCount(int new_input_count) {
98 DCHECK_LE(new_input_count, input_count()); 98 DCHECK_LE(new_input_count, input_count());
99 if (new_input_count == input_count()) return; // Nothing to do. 99 if (new_input_count == input_count()) return; // Nothing to do.
100 for (int index = new_input_count; index < input_count(); ++index) { 100 for (int index = new_input_count; index < input_count(); ++index) {
101 ReplaceInput(index, nullptr); 101 ReplaceInput(index, nullptr);
102 } 102 }
103 if (!has_appendable_inputs()) { 103 if (has_appendable_inputs()) {
104 inputs_.appendable_->resize(new_input_count);
105 } else {
104 set_reserved_input_count(std::min<int>( 106 set_reserved_input_count(std::min<int>(
105 ReservedInputCountField::kMax, 107 ReservedInputCountField::kMax,
106 reserved_input_count() + (input_count() - new_input_count))); 108 reserved_input_count() + (input_count() - new_input_count)));
107 } 109 }
108 set_input_count(new_input_count); 110 set_input_count(new_input_count);
109 } 111 }
110 112
111 113
112 int Node::UseCount() const { 114 int Node::UseCount() const {
113 int use_count = 0; 115 int use_count = 0;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 ++(*this); 270 ++(*this);
269 return result; 271 return result;
270 } 272 }
271 273
272 274
273 bool Node::Uses::empty() const { return begin() == end(); } 275 bool Node::Uses::empty() const { return begin() == end(); }
274 276
275 } // namespace compiler 277 } // namespace compiler
276 } // namespace internal 278 } // namespace internal
277 } // namespace v8 279 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/node.h ('k') | test/unittests/compiler/node-unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698