| 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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 break; | 128 break; |
| 129 case JS_OBJECT_TYPE: // fall through | 129 case JS_OBJECT_TYPE: // fall through |
| 130 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: | 130 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: |
| 131 case JS_ARRAY_TYPE: | 131 case JS_ARRAY_TYPE: |
| 132 case JS_REGEXP_TYPE: | 132 case JS_REGEXP_TYPE: |
| 133 JSObject::cast(this)->JSObjectPrint(out); | 133 JSObject::cast(this)->JSObjectPrint(out); |
| 134 break; | 134 break; |
| 135 case ODDBALL_TYPE: | 135 case ODDBALL_TYPE: |
| 136 Oddball::cast(this)->to_string()->Print(out); | 136 Oddball::cast(this)->to_string()->Print(out); |
| 137 break; | 137 break; |
| 138 case JS_MODULE_TYPE: |
| 139 JSModule::cast(this)->JSModulePrint(out); |
| 140 break; |
| 138 case JS_FUNCTION_TYPE: | 141 case JS_FUNCTION_TYPE: |
| 139 JSFunction::cast(this)->JSFunctionPrint(out); | 142 JSFunction::cast(this)->JSFunctionPrint(out); |
| 140 break; | 143 break; |
| 141 case JS_GLOBAL_PROXY_TYPE: | 144 case JS_GLOBAL_PROXY_TYPE: |
| 142 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out); | 145 JSGlobalProxy::cast(this)->JSGlobalProxyPrint(out); |
| 143 break; | 146 break; |
| 144 case JS_GLOBAL_OBJECT_TYPE: | 147 case JS_GLOBAL_OBJECT_TYPE: |
| 145 JSGlobalObject::cast(this)->JSGlobalObjectPrint(out); | 148 JSGlobalObject::cast(this)->JSGlobalObjectPrint(out); |
| 146 break; | 149 break; |
| 147 case JS_BUILTINS_OBJECT_TYPE: | 150 case JS_BUILTINS_OBJECT_TYPE: |
| 148 JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out); | 151 JSBuiltinsObject::cast(this)->JSBuiltinsObjectPrint(out); |
| 149 break; | 152 break; |
| 150 case JS_VALUE_TYPE: | 153 case JS_VALUE_TYPE: |
| 151 PrintF(out, "Value wrapper around:"); | 154 PrintF(out, "Value wrapper around:"); |
| 152 JSValue::cast(this)->value()->Print(out); | 155 JSValue::cast(this)->value()->Print(out); |
| 153 break; | 156 break; |
| 154 case JS_DATE_TYPE: | 157 case JS_DATE_TYPE: |
| 155 JSDate::cast(this)->value()->Print(out); | 158 JSDate::cast(this)->JSDatePrint(out); |
| 156 break; | 159 break; |
| 157 case CODE_TYPE: | 160 case CODE_TYPE: |
| 158 Code::cast(this)->CodePrint(out); | 161 Code::cast(this)->CodePrint(out); |
| 159 break; | 162 break; |
| 160 case JS_PROXY_TYPE: | 163 case JS_PROXY_TYPE: |
| 161 JSProxy::cast(this)->JSProxyPrint(out); | 164 JSProxy::cast(this)->JSProxyPrint(out); |
| 162 break; | 165 break; |
| 163 case JS_FUNCTION_PROXY_TYPE: | 166 case JS_FUNCTION_PROXY_TYPE: |
| 164 JSFunctionProxy::cast(this)->JSFunctionProxyPrint(out); | 167 JSFunctionProxy::cast(this)->JSFunctionProxyPrint(out); |
| 165 break; | 168 break; |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 PrintF(out, | 433 PrintF(out, |
| 431 "]\n - prototype = %p\n", | 434 "]\n - prototype = %p\n", |
| 432 reinterpret_cast<void*>(GetPrototype())); | 435 reinterpret_cast<void*>(GetPrototype())); |
| 433 PrintF(out, " {\n"); | 436 PrintF(out, " {\n"); |
| 434 PrintProperties(out); | 437 PrintProperties(out); |
| 435 PrintElements(out); | 438 PrintElements(out); |
| 436 PrintF(out, " }\n"); | 439 PrintF(out, " }\n"); |
| 437 } | 440 } |
| 438 | 441 |
| 439 | 442 |
| 443 void JSModule::JSModulePrint(FILE* out) { |
| 444 HeapObject::PrintHeader(out, "JSModule"); |
| 445 PrintF(out, " - map = 0x%p\n", reinterpret_cast<void*>(map())); |
| 446 PrintF(out, " - context = "); |
| 447 context()->Print(out); |
| 448 PrintElementsKind(out, this->map()->elements_kind()); |
| 449 PrintF(out, " {\n"); |
| 450 PrintProperties(out); |
| 451 PrintElements(out); |
| 452 PrintF(out, " }\n"); |
| 453 } |
| 454 |
| 455 |
| 440 static const char* TypeToString(InstanceType type) { | 456 static const char* TypeToString(InstanceType type) { |
| 441 switch (type) { | 457 switch (type) { |
| 442 case INVALID_TYPE: return "INVALID"; | 458 case INVALID_TYPE: return "INVALID"; |
| 443 case MAP_TYPE: return "MAP"; | 459 case MAP_TYPE: return "MAP"; |
| 444 case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; | 460 case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; |
| 445 case SYMBOL_TYPE: return "SYMBOL"; | 461 case SYMBOL_TYPE: return "SYMBOL"; |
| 446 case ASCII_SYMBOL_TYPE: return "ASCII_SYMBOL"; | 462 case ASCII_SYMBOL_TYPE: return "ASCII_SYMBOL"; |
| 447 case CONS_SYMBOL_TYPE: return "CONS_SYMBOL"; | 463 case CONS_SYMBOL_TYPE: return "CONS_SYMBOL"; |
| 448 case CONS_ASCII_SYMBOL_TYPE: return "CONS_ASCII_SYMBOL"; | 464 case CONS_ASCII_SYMBOL_TYPE: return "CONS_ASCII_SYMBOL"; |
| 449 case EXTERNAL_ASCII_SYMBOL_TYPE: | 465 case EXTERNAL_ASCII_SYMBOL_TYPE: |
| (...skipping 26 matching lines...) Expand all Loading... |
| 476 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: | 492 case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
| 477 return "EXTERNAL_UNSIGNED_INT_ARRAY"; | 493 return "EXTERNAL_UNSIGNED_INT_ARRAY"; |
| 478 case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; | 494 case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; |
| 479 case EXTERNAL_DOUBLE_ARRAY_TYPE: return "EXTERNAL_DOUBLE_ARRAY"; | 495 case EXTERNAL_DOUBLE_ARRAY_TYPE: return "EXTERNAL_DOUBLE_ARRAY"; |
| 480 case FILLER_TYPE: return "FILLER"; | 496 case FILLER_TYPE: return "FILLER"; |
| 481 case JS_OBJECT_TYPE: return "JS_OBJECT"; | 497 case JS_OBJECT_TYPE: return "JS_OBJECT"; |
| 482 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; | 498 case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; |
| 483 case ODDBALL_TYPE: return "ODDBALL"; | 499 case ODDBALL_TYPE: return "ODDBALL"; |
| 484 case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; | 500 case JS_GLOBAL_PROPERTY_CELL_TYPE: return "JS_GLOBAL_PROPERTY_CELL"; |
| 485 case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; | 501 case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; |
| 502 case JS_MODULE_TYPE: return "JS_MODULE"; |
| 486 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; | 503 case JS_FUNCTION_TYPE: return "JS_FUNCTION"; |
| 487 case CODE_TYPE: return "CODE"; | 504 case CODE_TYPE: return "CODE"; |
| 488 case JS_ARRAY_TYPE: return "JS_ARRAY"; | 505 case JS_ARRAY_TYPE: return "JS_ARRAY"; |
| 489 case JS_PROXY_TYPE: return "JS_PROXY"; | 506 case JS_PROXY_TYPE: return "JS_PROXY"; |
| 490 case JS_WEAK_MAP_TYPE: return "JS_WEAK_MAP"; | 507 case JS_WEAK_MAP_TYPE: return "JS_WEAK_MAP"; |
| 491 case JS_REGEXP_TYPE: return "JS_REGEXP"; | 508 case JS_REGEXP_TYPE: return "JS_REGEXP"; |
| 492 case JS_VALUE_TYPE: return "JS_VALUE"; | 509 case JS_VALUE_TYPE: return "JS_VALUE"; |
| 493 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; | 510 case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; |
| 494 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; | 511 case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; |
| 495 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; | 512 case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1011 desc.Print(out); | 1028 desc.Print(out); |
| 1012 } | 1029 } |
| 1013 PrintF(out, "\n"); | 1030 PrintF(out, "\n"); |
| 1014 } | 1031 } |
| 1015 | 1032 |
| 1016 | 1033 |
| 1017 #endif // OBJECT_PRINT | 1034 #endif // OBJECT_PRINT |
| 1018 | 1035 |
| 1019 | 1036 |
| 1020 } } // namespace v8::internal | 1037 } } // namespace v8::internal |
| OLD | NEW |