Index: src/compiler/node.cc |
diff --git a/src/compiler/node.cc b/src/compiler/node.cc |
index 260870fbe81c1ac7d9ac3bc30150e9dbd9d34c69..670c3afbdf364dc144750080396fb4e37bac5ef5 100644 |
--- a/src/compiler/node.cc |
+++ b/src/compiler/node.cc |
@@ -4,10 +4,25 @@ |
#include "src/compiler/node.h" |
+#include "src/compiler/generic-node-inl.h" |
+ |
namespace v8 { |
namespace internal { |
namespace compiler { |
+void Node::CollectProjections(int projection_count, Node** projections) { |
+ for (int i = 0; i < projection_count; ++i) projections[i] = NULL; |
+ for (UseIter i = uses().begin(); i != uses().end(); ++i) { |
+ if ((*i)->opcode() != IrOpcode::kProjection) continue; |
+ int32_t index = OpParameter<int32_t>(*i); |
+ ASSERT_GE(index, 0); |
+ ASSERT_LT(index, projection_count); |
+ ASSERT_EQ(NULL, projections[index]); |
+ projections[index] = *i; |
+ } |
+} |
+ |
+ |
OStream& operator<<(OStream& os, const Operator& op) { return op.PrintTo(os); } |
@@ -23,6 +38,7 @@ OStream& operator<<(OStream& os, const Node& n) { |
} |
return os; |
} |
-} |
-} |
-} // namespace v8::internal::compiler |
+ |
+} // namespace compiler |
+} // namespace internal |
+} // namespace v8 |