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

Unified Diff: src/assembler.cc

Issue 363323003: More OStreamsUse OStreams more often. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased and polished. Created 6 years, 5 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/assembler.h ('k') | src/ast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/assembler.cc
diff --git a/src/assembler.cc b/src/assembler.cc
index 923606e7762b2d3ce4e2a3b4c4bdc837305bc7b7..4faf6430bfb00daceb1d99e3fbb9d69e789571da 100644
--- a/src/assembler.cc
+++ b/src/assembler.cc
@@ -813,39 +813,36 @@ const char* RelocInfo::RelocModeName(RelocInfo::Mode rmode) {
}
-void RelocInfo::Print(Isolate* isolate, FILE* out) {
- PrintF(out, "%p %s", pc_, RelocModeName(rmode_));
+void RelocInfo::Print(Isolate* isolate, OStream& os) { // NOLINT
+ os << pc_ << " " << RelocModeName(rmode_);
if (IsComment(rmode_)) {
- PrintF(out, " (%s)", reinterpret_cast<char*>(data_));
+ os << " (" << reinterpret_cast<char*>(data_) << ")";
} else if (rmode_ == EMBEDDED_OBJECT) {
- PrintF(out, " (");
- target_object()->ShortPrint(out);
- PrintF(out, ")");
+ os << " (" << Brief(target_object()) << ")";
} else if (rmode_ == EXTERNAL_REFERENCE) {
ExternalReferenceEncoder ref_encoder(isolate);
- PrintF(out, " (%s) (%p)",
- ref_encoder.NameOfAddress(target_reference()),
- target_reference());
+ os << " (" << ref_encoder.NameOfAddress(target_reference()) << ") ("
+ << target_reference() << ")";
} else if (IsCodeTarget(rmode_)) {
Code* code = Code::GetCodeFromTargetAddress(target_address());
- PrintF(out, " (%s) (%p)", Code::Kind2String(code->kind()),
- target_address());
+ os << " (" << Code::Kind2String(code->kind()) << ") (" << target_address()
+ << ")";
if (rmode_ == CODE_TARGET_WITH_ID) {
- PrintF(out, " (id=%d)", static_cast<int>(data_));
+ os << " (id=" << static_cast<int>(data_) << ")";
}
} else if (IsPosition(rmode_)) {
- PrintF(out, " (%" V8_PTR_PREFIX "d)", data());
+ os << " (" << data() << ")";
} else if (IsRuntimeEntry(rmode_) &&
isolate->deoptimizer_data() != NULL) {
// Depotimization bailouts are stored as runtime entries.
int id = Deoptimizer::GetDeoptimizationId(
isolate, target_address(), Deoptimizer::EAGER);
if (id != Deoptimizer::kNotDeoptimizationEntry) {
- PrintF(out, " (deoptimization bailout %d)", id);
+ os << " (deoptimization bailout " << id << ")";
}
}
- PrintF(out, "\n");
+ os << "\n";
}
#endif // ENABLE_DISASSEMBLER
« no previous file with comments | « src/assembler.h ('k') | src/ast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698