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

Unified Diff: src/hydrogen-instructions.cc

Issue 334763003: Start using OStreams. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased. Reformatted. Feedback addressed. Created 6 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen-instructions.cc
diff --git a/src/hydrogen-instructions.cc b/src/hydrogen-instructions.cc
index 9209b88732538416919054f86750ecce775d3104..173a316847f669b324d08d13ed4f1e9b1d56d997 100644
--- a/src/hydrogen-instructions.cc
+++ b/src/hydrogen-instructions.cc
@@ -525,6 +525,15 @@ void HValue::SetBlock(HBasicBlock* block) {
}
+OStream& operator<<(OStream& os, const HValue& v) {
+ // TODO(svenpanne) Temporary impedance matching, to be removed later.
+ HeapStringAllocator allocator;
+ StringStream stream(&allocator);
+ const_cast<HValue*>(&v)->PrintTo(&stream);
+ return os << stream.ToCString().get();
+}
+
+
void HValue::PrintTypeTo(StringStream* stream) {
if (!representation().IsTagged() || type().Equals(HType::Tagged())) return;
stream->Add(" type:%s", type().ToString());
@@ -1214,8 +1223,9 @@ bool HBranch::KnownSuccessorBlock(HBasicBlock** block) {
void HBranch::PrintDataTo(StringStream* stream) {
HUnaryControlInstruction::PrintDataTo(stream);
- stream->Add(" ");
- expected_input_types().Print(stream);
+ OStringStream os;
+ os << " " << expected_input_types();
+ stream->Add(os.c_str());
}
« no previous file with comments | « src/hydrogen-instructions.h ('k') | src/ia32/code-stubs-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698