OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 22 matching lines...) Expand all Loading... |
33 #include "objects-visiting.h" | 33 #include "objects-visiting.h" |
34 | 34 |
35 namespace v8 { | 35 namespace v8 { |
36 namespace internal { | 36 namespace internal { |
37 | 37 |
38 #ifdef OBJECT_PRINT | 38 #ifdef OBJECT_PRINT |
39 | 39 |
40 static const char* TypeToString(InstanceType type); | 40 static const char* TypeToString(InstanceType type); |
41 | 41 |
42 | 42 |
| 43 void MaybeObject::Print() { |
| 44 Print(stdout); |
| 45 } |
| 46 |
| 47 |
43 void MaybeObject::Print(FILE* out) { | 48 void MaybeObject::Print(FILE* out) { |
44 Object* this_as_object; | 49 Object* this_as_object; |
45 if (ToObject(&this_as_object)) { | 50 if (ToObject(&this_as_object)) { |
46 if (this_as_object->IsSmi()) { | 51 if (this_as_object->IsSmi()) { |
47 Smi::cast(this_as_object)->SmiPrint(out); | 52 Smi::cast(this_as_object)->SmiPrint(out); |
48 } else { | 53 } else { |
49 HeapObject::cast(this_as_object)->HeapObjectPrint(out); | 54 HeapObject::cast(this_as_object)->HeapObjectPrint(out); |
50 } | 55 } |
51 } else { | 56 } else { |
52 Failure::cast(this)->FailurePrint(out); | 57 Failure::cast(this)->FailurePrint(out); |
53 } | 58 } |
54 Flush(out); | 59 Flush(out); |
55 } | 60 } |
56 | 61 |
57 | 62 |
| 63 void MaybeObject::PrintLn() { |
| 64 PrintLn(stdout); |
| 65 } |
| 66 |
| 67 |
58 void MaybeObject::PrintLn(FILE* out) { | 68 void MaybeObject::PrintLn(FILE* out) { |
59 Print(out); | 69 Print(out); |
60 PrintF(out, "\n"); | 70 PrintF(out, "\n"); |
61 } | 71 } |
62 | 72 |
63 | 73 |
64 void HeapObject::PrintHeader(FILE* out, const char* id) { | 74 void HeapObject::PrintHeader(FILE* out, const char* id) { |
65 PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id); | 75 PrintF(out, "%p: [%s]\n", reinterpret_cast<void*>(this), id); |
66 } | 76 } |
67 | 77 |
(...skipping 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1256 } | 1266 } |
1257 } | 1267 } |
1258 PrintF(out, "\n"); | 1268 PrintF(out, "\n"); |
1259 } | 1269 } |
1260 | 1270 |
1261 | 1271 |
1262 #endif // OBJECT_PRINT | 1272 #endif // OBJECT_PRINT |
1263 | 1273 |
1264 | 1274 |
1265 } } // namespace v8::internal | 1275 } } // namespace v8::internal |
OLD | NEW |