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

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

Issue 1366753003: [turbofan] Make Node::set_op safer via wrapper. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments. Created 5 years, 2 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-properties.h ('k') | src/compiler/osr.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/common-operator.h" 5 #include "src/compiler/common-operator.h"
6 #include "src/compiler/graph.h" 6 #include "src/compiler/graph.h"
7 #include "src/compiler/node-properties.h" 7 #include "src/compiler/node-properties.h"
8 #include "src/compiler/operator-properties.h" 8 #include "src/compiler/operator-properties.h"
9 9
10 namespace v8 { 10 namespace v8 {
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 edge.UpdateTo(effect); 189 edge.UpdateTo(effect);
190 } else { 190 } else {
191 DCHECK_NOT_NULL(value); 191 DCHECK_NOT_NULL(value);
192 edge.UpdateTo(value); 192 edge.UpdateTo(value);
193 } 193 }
194 } 194 }
195 } 195 }
196 196
197 197
198 // static 198 // static
199 void NodeProperties::ChangeOp(Node* node, const Operator* new_op) {
200 DCHECK_EQ(OperatorProperties::GetTotalInputCount(new_op), node->InputCount());
201 node->set_op(new_op);
202 }
203
204
205 // static
199 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) { 206 Node* NodeProperties::FindProjection(Node* node, size_t projection_index) {
200 for (auto use : node->uses()) { 207 for (auto use : node->uses()) {
201 if (use->opcode() == IrOpcode::kProjection && 208 if (use->opcode() == IrOpcode::kProjection &&
202 ProjectionIndexOf(use->op()) == projection_index) { 209 ProjectionIndexOf(use->op()) == projection_index) {
203 return use; 210 return use;
204 } 211 }
205 } 212 }
206 return nullptr; 213 return nullptr;
207 } 214 }
208 215
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 // static 280 // static
274 bool NodeProperties::IsInputRange(Edge edge, int first, int num) { 281 bool NodeProperties::IsInputRange(Edge edge, int first, int num) {
275 if (num == 0) return false; 282 if (num == 0) return false;
276 int const index = edge.index(); 283 int const index = edge.index();
277 return first <= index && index < first + num; 284 return first <= index && index < first + num;
278 } 285 }
279 286
280 } // namespace compiler 287 } // namespace compiler
281 } // namespace internal 288 } // namespace internal
282 } // namespace v8 289 } // namespace v8
OLDNEW
« no previous file with comments | « src/compiler/node-properties.h ('k') | src/compiler/osr.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698