Index: src/compiler/source-position.cc |
diff --git a/src/compiler/source-position.cc b/src/compiler/source-position.cc |
index 2ef18548ddded676605e6c60817aca162dc2701c..f5756560657b97797b00048b34d7aaff0dc7bf02 100644 |
--- a/src/compiler/source-position.cc |
+++ b/src/compiler/source-position.cc |
@@ -50,6 +50,24 @@ SourcePosition SourcePositionTable::GetSourcePosition(Node* node) const { |
return table_.Get(node); |
} |
+ |
+void SourcePositionTable::Print(std::ostream& os) const { |
+ os << "{"; |
+ bool needs_comma = false; |
+ for (auto i : table_) { |
+ SourcePosition pos = i.second; |
+ if (!pos.IsUnknown()) { |
+ if (needs_comma) { |
+ os << ","; |
+ } |
+ os << "\"" << i.first << "\"" |
+ << ":" << pos.raw(); |
+ needs_comma = true; |
+ } |
+ } |
+ os << "}"; |
+} |
+ |
} // namespace compiler |
} // namespace internal |
} // namespace v8 |