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

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

Issue 503023002: Fix int comparison with vector::size. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 "src/compiler/generic-node-inl.h" 7 #include "src/compiler/generic-node-inl.h"
8 8
9 namespace v8 { 9 namespace v8 {
10 namespace internal { 10 namespace internal {
11 namespace compiler { 11 namespace compiler {
12 12
13 void Node::CollectProjections(NodeVector* projections) { 13 void Node::CollectProjections(NodeVector* projections) {
14 for (size_t i = 0; i < projections->size(); i++) { 14 for (size_t i = 0; i < projections->size(); i++) {
15 (*projections)[i] = NULL; 15 (*projections)[i] = NULL;
16 } 16 }
17 for (UseIter i = uses().begin(); i != uses().end(); ++i) { 17 for (UseIter i = uses().begin(); i != uses().end(); ++i) {
18 if ((*i)->opcode() != IrOpcode::kProjection) continue; 18 if ((*i)->opcode() != IrOpcode::kProjection) continue;
19 int32_t index = OpParameter<int32_t>(*i); 19 int32_t index = OpParameter<int32_t>(*i);
20 DCHECK_GE(index, 0); 20 DCHECK_GE(index, 0);
21 DCHECK_LT(index, projections->size()); 21 DCHECK_LT(index, static_cast<int32_t>(projections->size()));
22 DCHECK_EQ(NULL, (*projections)[index]); 22 DCHECK_EQ(NULL, (*projections)[index]);
23 (*projections)[index] = *i; 23 (*projections)[index] = *i;
24 } 24 }
25 } 25 }
26 26
27 27
28 Node* Node::FindProjection(int32_t projection_index) { 28 Node* Node::FindProjection(int32_t projection_index) {
29 for (UseIter i = uses().begin(); i != uses().end(); ++i) { 29 for (UseIter i = uses().begin(); i != uses().end(); ++i) {
30 if ((*i)->opcode() == IrOpcode::kProjection && 30 if ((*i)->opcode() == IrOpcode::kProjection &&
31 OpParameter<int32_t>(*i) == projection_index) { 31 OpParameter<int32_t>(*i) == projection_index) {
(...skipping 16 matching lines...) Expand all
48 os << n.InputAt(i)->id(); 48 os << n.InputAt(i)->id();
49 } 49 }
50 os << ")"; 50 os << ")";
51 } 51 }
52 return os; 52 return os;
53 } 53 }
54 54
55 } // namespace compiler 55 } // namespace compiler
56 } // namespace internal 56 } // namespace internal
57 } // namespace v8 57 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698