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

Unified Diff: src/safepoint-table.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/safepoint-table.h ('k') | src/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/safepoint-table.cc
diff --git a/src/safepoint-table.cc b/src/safepoint-table.cc
index e041e17ca9f8c78d35e04f6834b296d1ab2709db..a619228ab23090e78b41bc3b9755851b2831196a 100644
--- a/src/safepoint-table.cc
+++ b/src/safepoint-table.cc
@@ -60,7 +60,7 @@ SafepointEntry SafepointTable::FindEntry(Address pc) const {
}
-void SafepointTable::PrintEntry(unsigned index, FILE* out) const {
+void SafepointTable::PrintEntry(unsigned index, OStream& os) const { // NOLINT
disasm::NameConverter converter;
SafepointEntry entry = GetEntry(index);
uint8_t* bits = entry.bits();
@@ -70,25 +70,26 @@ void SafepointTable::PrintEntry(unsigned index, FILE* out) const {
ASSERT(IsAligned(kNumSafepointRegisters, kBitsPerByte));
const int first = kNumSafepointRegisters >> kBitsPerByteLog2;
int last = entry_size_ - 1;
- for (int i = first; i < last; i++) PrintBits(out, bits[i], kBitsPerByte);
+ for (int i = first; i < last; i++) PrintBits(os, bits[i], kBitsPerByte);
int last_bits = code_->stack_slots() - ((last - first) * kBitsPerByte);
- PrintBits(out, bits[last], last_bits);
+ PrintBits(os, bits[last], last_bits);
// Print the registers (if any).
if (!entry.HasRegisters()) return;
for (int j = 0; j < kNumSafepointRegisters; j++) {
if (entry.HasRegisterAt(j)) {
- PrintF(out, " | %s", converter.NameOfCPURegister(j));
+ os << " | " << converter.NameOfCPURegister(j);
}
}
}
}
-void SafepointTable::PrintBits(FILE* out, uint8_t byte, int digits) {
+void SafepointTable::PrintBits(OStream& os, // NOLINT
+ uint8_t byte, int digits) {
ASSERT(digits >= 0 && digits <= kBitsPerByte);
for (int i = 0; i < digits; i++) {
- PrintF(out, "%c", ((byte & (1 << i)) == 0) ? '0' : '1');
+ os << (((byte & (1 << i)) == 0) ? "0" : "1");
}
}
« no previous file with comments | « src/safepoint-table.h ('k') | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698