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

Unified Diff: src/property.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/objects.cc ('k') | src/string-stream.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/property.cc
diff --git a/src/property.cc b/src/property.cc
index 24b39a959215e0eac9dc7760f3c7b482a5ac3918..31f5e9a37436e40bbe14dbea25b1217cfd2e0e21 100644
--- a/src/property.cc
+++ b/src/property.cc
@@ -21,47 +21,48 @@ void LookupResult::Iterate(ObjectVisitor* visitor) {
#ifdef OBJECT_PRINT
void LookupResult::Print(FILE* out) {
+ OFStream os(out);
if (!IsFound()) {
- PrintF(out, "Not Found\n");
+ os << "Not Found\n";
return;
}
- PrintF(out, "LookupResult:\n");
- PrintF(out, " -cacheable = %s\n", IsCacheable() ? "true" : "false");
- PrintF(out, " -attributes = %x\n", GetAttributes());
+ os << "LookupResult:\n";
+ os << " -cacheable = " << (IsCacheable() ? "true" : "false") << "\n";
+ os << " -attributes = " << hex << GetAttributes() << dec << "\n";
if (IsTransition()) {
- PrintF(out, " -transition target:\n");
+ os << " -transition target:\n";
GetTransitionTarget()->Print(out);
- PrintF(out, "\n");
+ os << "\n";
}
switch (type()) {
case NORMAL:
- PrintF(out, " -type = normal\n");
- PrintF(out, " -entry = %d", GetDictionaryEntry());
+ os << " -type = normal\n"
+ << " -entry = " << GetDictionaryEntry() << "\n";
break;
case CONSTANT:
- PrintF(out, " -type = constant\n");
- PrintF(out, " -value:\n");
+ os << " -type = constant\n"
+ << " -value:\n";
GetConstant()->Print(out);
- PrintF(out, "\n");
+ os << "\n";
break;
case FIELD:
- PrintF(out, " -type = field\n");
- PrintF(out, " -index = %d\n",
- GetFieldIndex().property_index());
- PrintF(out, " -field type:\n");
- GetFieldType()->TypePrint(out);
+ os << " -type = field\n"
+ << " -index = " << GetFieldIndex().property_index() << "\n"
+ << " -field type:";
+ GetFieldType()->PrintTo(os);
+ os << "\n";
break;
case CALLBACKS:
- PrintF(out, " -type = call backs\n");
- PrintF(out, " -callback object:\n");
+ os << " -type = call backs\n"
+ << " -callback object:\n";
GetCallbackObject()->Print(out);
break;
case HANDLER:
- PrintF(out, " -type = lookup proxy\n");
+ os << " -type = lookup proxy\n";
break;
case INTERCEPTOR:
- PrintF(out, " -type = lookup interceptor\n");
+ os << " -type = lookup interceptor\n";
break;
case NONEXISTENT:
UNREACHABLE();
« no previous file with comments | « src/objects.cc ('k') | src/string-stream.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698