OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 break; | 144 break; |
145 case CODE_TYPE: | 145 case CODE_TYPE: |
146 Code::cast(this)->CodePrint(out); | 146 Code::cast(this)->CodePrint(out); |
147 break; | 147 break; |
148 case PROXY_TYPE: | 148 case PROXY_TYPE: |
149 Proxy::cast(this)->ProxyPrint(out); | 149 Proxy::cast(this)->ProxyPrint(out); |
150 break; | 150 break; |
151 case SHARED_FUNCTION_INFO_TYPE: | 151 case SHARED_FUNCTION_INFO_TYPE: |
152 SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out); | 152 SharedFunctionInfo::cast(this)->SharedFunctionInfoPrint(out); |
153 break; | 153 break; |
| 154 case JS_MESSAGE_OBJECT_TYPE: |
| 155 JSMessageObject::cast(this)->JSMessageObjectPrint(out); |
| 156 break; |
154 case JS_GLOBAL_PROPERTY_CELL_TYPE: | 157 case JS_GLOBAL_PROPERTY_CELL_TYPE: |
155 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); | 158 JSGlobalPropertyCell::cast(this)->JSGlobalPropertyCellPrint(out); |
156 break; | 159 break; |
157 #define MAKE_STRUCT_CASE(NAME, Name, name) \ | 160 #define MAKE_STRUCT_CASE(NAME, Name, name) \ |
158 case NAME##_TYPE: \ | 161 case NAME##_TYPE: \ |
159 Name::cast(this)->Name##Print(out); \ | 162 Name::cast(this)->Name##Print(out); \ |
160 break; | 163 break; |
161 STRUCT_LIST(MAKE_STRUCT_CASE) | 164 STRUCT_LIST(MAKE_STRUCT_CASE) |
162 #undef MAKE_STRUCT_CASE | 165 #undef MAKE_STRUCT_CASE |
163 | 166 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; | 392 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; |
390 case CODE_TYPE: return "CODE"; | 393 case CODE_TYPE: return "CODE"; |
391 case JS_ARRAY_TYPE: return "JS_ARRAY"; | 394 case JS_ARRAY_TYPE: return "JS_ARRAY"; |
392 case JS_REGEXP_TYPE: return "JS_REGEXP"; | 395 case JS_REGEXP_TYPE: return "JS_REGEXP"; |
393 case JS_VALUE_TYPE: return "JS_VALUE"; | 396 case JS_VALUE_TYPE: return "JS_VALUE"; |
394 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; | 397 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; |
395 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; | 398 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; |
396 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; | 399 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; |
397 case PROXY_TYPE: return "PROXY"; | 400 case PROXY_TYPE: return "PROXY"; |
398 case LAST_STRING_TYPE: return "LAST_STRING_TYPE"; | 401 case LAST_STRING_TYPE: return "LAST_STRING_TYPE"; |
| 402 case JS_MESSAGE_OBJECT_TYPE: return "JS_MESSAGE_OBJECT_TYPE"; |
399 #define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; | 403 #define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; |
400 STRUCT_LIST(MAKE_STRUCT_CASE) | 404 STRUCT_LIST(MAKE_STRUCT_CASE) |
401 #undef MAKE_STRUCT_CASE | 405 #undef MAKE_STRUCT_CASE |
402 } | 406 } |
403 return "UNKNOWN"; | 407 return "UNKNOWN"; |
404 } | 408 } |
405 | 409 |
406 | 410 |
407 void Map::MapPrint(FILE* out) { | 411 void Map::MapPrint(FILE* out) { |
408 HeapObject::PrintHeader(out, "Map"); | 412 HeapObject::PrintHeader(out, "Map"); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 PrintF(out, "\n"); | 463 PrintF(out, "\n"); |
460 } | 464 } |
461 | 465 |
462 | 466 |
463 void JSValue::JSValuePrint(FILE* out) { | 467 void JSValue::JSValuePrint(FILE* out) { |
464 HeapObject::PrintHeader(out, "ValueObject"); | 468 HeapObject::PrintHeader(out, "ValueObject"); |
465 value()->Print(out); | 469 value()->Print(out); |
466 } | 470 } |
467 | 471 |
468 | 472 |
| 473 void JSMessageObject::JSMessageObjectPrint(FILE* out) { |
| 474 HeapObject::PrintHeader(out, "JSMessageObject"); |
| 475 PrintF(out, " - type: "); |
| 476 type()->ShortPrint(out); |
| 477 PrintF(out, "\n - arguments: "); |
| 478 arguments()->ShortPrint(out); |
| 479 PrintF(out, "\n - start_position: %d", start_position()); |
| 480 PrintF(out, "\n - end_position: %d", end_position()); |
| 481 PrintF(out, "\n - script: "); |
| 482 script()->ShortPrint(out); |
| 483 PrintF(out, "\n - stack_trace: "); |
| 484 stack_trace()->ShortPrint(out); |
| 485 PrintF(out, "\n - stack_frames: "); |
| 486 stack_frames()->ShortPrint(out); |
| 487 PrintF(out, "\n"); |
| 488 } |
| 489 |
| 490 |
469 void String::StringPrint(FILE* out) { | 491 void String::StringPrint(FILE* out) { |
470 if (StringShape(this).IsSymbol()) { | 492 if (StringShape(this).IsSymbol()) { |
471 PrintF(out, "#"); | 493 PrintF(out, "#"); |
472 } else if (StringShape(this).IsCons()) { | 494 } else if (StringShape(this).IsCons()) { |
473 PrintF(out, "c\""); | 495 PrintF(out, "c\""); |
474 } else { | 496 } else { |
475 PrintF(out, "\""); | 497 PrintF(out, "\""); |
476 } | 498 } |
477 | 499 |
478 const char truncated_epilogue[] = "...<truncated>"; | 500 const char truncated_epilogue[] = "...<truncated>"; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 desc.Print(out); | 792 desc.Print(out); |
771 } | 793 } |
772 PrintF(out, "\n"); | 794 PrintF(out, "\n"); |
773 } | 795 } |
774 | 796 |
775 | 797 |
776 #endif // OBJECT_PRINT | 798 #endif // OBJECT_PRINT |
777 | 799 |
778 | 800 |
779 } } // namespace v8::internal | 801 } } // namespace v8::internal |
OLD | NEW |