Index: src/objects-printer.cc |
diff --git a/src/objects-printer.cc b/src/objects-printer.cc |
index 87b2811e413507985304964d880188fb049a8dbf..7b6f7a478ce4b0d307467cf109e81aa355cc70a8 100644 |
--- a/src/objects-printer.cc |
+++ b/src/objects-printer.cc |
@@ -37,9 +37,6 @@ namespace internal { |
#ifdef OBJECT_PRINT |
-static const char* TypeToString(InstanceType type); |
- |
- |
void MaybeObject::Print() { |
Print(stdout); |
} |
@@ -509,83 +506,12 @@ void JSModule::JSModulePrint(FILE* out) { |
static const char* TypeToString(InstanceType type) { |
switch (type) { |
- case INVALID_TYPE: return "INVALID"; |
- case MAP_TYPE: return "MAP"; |
- case HEAP_NUMBER_TYPE: return "HEAP_NUMBER"; |
- case SYMBOL_TYPE: return "SYMBOL"; |
- case STRING_TYPE: return "TWO_BYTE_STRING"; |
- case ASCII_STRING_TYPE: return "ASCII_STRING"; |
- case CONS_STRING_TYPE: |
- case CONS_ASCII_STRING_TYPE: |
- return "CONS_STRING"; |
- case EXTERNAL_STRING_TYPE: |
- case EXTERNAL_ASCII_STRING_TYPE: |
- case EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE: |
- return "EXTERNAL_STRING"; |
- case SHORT_EXTERNAL_STRING_TYPE: |
- case SHORT_EXTERNAL_ASCII_STRING_TYPE: |
- case SHORT_EXTERNAL_STRING_WITH_ONE_BYTE_DATA_TYPE: |
- return "SHORT_EXTERNAL_STRING"; |
- case INTERNALIZED_STRING_TYPE: return "INTERNALIZED_STRING"; |
- case ASCII_INTERNALIZED_STRING_TYPE: return "ASCII_INTERNALIZED_STRING"; |
- case CONS_INTERNALIZED_STRING_TYPE: return "CONS_INTERNALIZED_STRING"; |
- case CONS_ASCII_INTERNALIZED_STRING_TYPE: |
- return "CONS_ASCII_INTERNALIZED_STRING"; |
- case EXTERNAL_INTERNALIZED_STRING_TYPE: |
- case EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE: |
- case EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE: |
- return "EXTERNAL_INTERNALIZED_STRING"; |
- case SHORT_EXTERNAL_INTERNALIZED_STRING_TYPE: |
- case SHORT_EXTERNAL_ASCII_INTERNALIZED_STRING_TYPE: |
- case SHORT_EXTERNAL_INTERNALIZED_STRING_WITH_ONE_BYTE_DATA_TYPE: |
- return "SHORT_EXTERNAL_INTERNALIZED_STRING"; |
- case FIXED_ARRAY_TYPE: return "FIXED_ARRAY"; |
- case BYTE_ARRAY_TYPE: return "BYTE_ARRAY"; |
- case FREE_SPACE_TYPE: return "FREE_SPACE"; |
- case EXTERNAL_PIXEL_ARRAY_TYPE: return "EXTERNAL_PIXEL_ARRAY"; |
- case EXTERNAL_BYTE_ARRAY_TYPE: return "EXTERNAL_BYTE_ARRAY"; |
- case EXTERNAL_UNSIGNED_BYTE_ARRAY_TYPE: |
- return "EXTERNAL_UNSIGNED_BYTE_ARRAY"; |
- case EXTERNAL_SHORT_ARRAY_TYPE: return "EXTERNAL_SHORT_ARRAY"; |
- case EXTERNAL_UNSIGNED_SHORT_ARRAY_TYPE: |
- return "EXTERNAL_UNSIGNED_SHORT_ARRAY"; |
- case EXTERNAL_INT_ARRAY_TYPE: return "EXTERNAL_INT_ARRAY"; |
- case EXTERNAL_UNSIGNED_INT_ARRAY_TYPE: |
- return "EXTERNAL_UNSIGNED_INT_ARRAY"; |
- case EXTERNAL_FLOAT_ARRAY_TYPE: return "EXTERNAL_FLOAT_ARRAY"; |
- case EXTERNAL_DOUBLE_ARRAY_TYPE: return "EXTERNAL_DOUBLE_ARRAY"; |
- case FILLER_TYPE: return "FILLER"; |
- case JS_OBJECT_TYPE: return "JS_OBJECT"; |
- case JS_CONTEXT_EXTENSION_OBJECT_TYPE: return "JS_CONTEXT_EXTENSION_OBJECT"; |
- case ODDBALL_TYPE: return "ODDBALL"; |
- case CELL_TYPE: return "CELL"; |
- case PROPERTY_CELL_TYPE: return "PROPERTY_CELL"; |
- case SHARED_FUNCTION_INFO_TYPE: return "SHARED_FUNCTION_INFO"; |
- case JS_GENERATOR_OBJECT_TYPE: return "JS_GENERATOR_OBJECT"; |
- case JS_MODULE_TYPE: return "JS_MODULE"; |
- case JS_FUNCTION_TYPE: return "JS_FUNCTION"; |
- case CODE_TYPE: return "CODE"; |
- case JS_ARRAY_TYPE: return "JS_ARRAY"; |
- case JS_PROXY_TYPE: return "JS_PROXY"; |
- case JS_SET_TYPE: return "JS_SET"; |
- case JS_MAP_TYPE: return "JS_MAP"; |
- case JS_WEAK_MAP_TYPE: return "JS_WEAK_MAP"; |
- case JS_WEAK_SET_TYPE: return "JS_WEAK_SET"; |
- case JS_REGEXP_TYPE: return "JS_REGEXP"; |
- case JS_VALUE_TYPE: return "JS_VALUE"; |
- case JS_GLOBAL_OBJECT_TYPE: return "JS_GLOBAL_OBJECT"; |
- case JS_BUILTINS_OBJECT_TYPE: return "JS_BUILTINS_OBJECT"; |
- case JS_GLOBAL_PROXY_TYPE: return "JS_GLOBAL_PROXY"; |
- case JS_ARRAY_BUFFER_TYPE: return "JS_ARRAY_BUFFER"; |
- case JS_TYPED_ARRAY_TYPE: return "JS_TYPED_ARRAY"; |
- case JS_DATA_VIEW_TYPE: return "JS_DATA_VIEW"; |
- case FOREIGN_TYPE: return "FOREIGN"; |
- case JS_MESSAGE_OBJECT_TYPE: return "JS_MESSAGE_OBJECT_TYPE"; |
-#define MAKE_STRUCT_CASE(NAME, Name, name) case NAME##_TYPE: return #NAME; |
- STRUCT_LIST(MAKE_STRUCT_CASE) |
-#undef MAKE_STRUCT_CASE |
- default: return "UNKNOWN"; |
+#define TYPE_TO_STRING(TYPE) case TYPE: return #TYPE; |
+ INSTANCE_TYPE_LIST(TYPE_TO_STRING) |
+#undef TYPE_TO_STRING |
} |
+ UNREACHABLE(); |
+ return "UNKNOWN"; // Keep the compiler happy. |
} |