| 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 1565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 printf("# List of known V8 instance types.\n"); | 1576 printf("# List of known V8 instance types.\n"); |
| 1577 #define DUMP_TYPE(T) printf(" %d: \"%s\",\n", i::T, #T); | 1577 #define DUMP_TYPE(T) printf(" %d: \"%s\",\n", i::T, #T); |
| 1578 printf("INSTANCE_TYPES = {\n"); | 1578 printf("INSTANCE_TYPES = {\n"); |
| 1579 INSTANCE_TYPE_LIST(DUMP_TYPE) | 1579 INSTANCE_TYPE_LIST(DUMP_TYPE) |
| 1580 printf("}\n"); | 1580 printf("}\n"); |
| 1581 #undef DUMP_TYPE | 1581 #undef DUMP_TYPE |
| 1582 | 1582 |
| 1583 // Dump the KNOWN_MAP table to the console. | 1583 // Dump the KNOWN_MAP table to the console. |
| 1584 printf("\n# List of known V8 maps.\n"); | 1584 printf("\n# List of known V8 maps.\n"); |
| 1585 #define ROOT_LIST_CASE(type, name, camel_name) \ | 1585 #define ROOT_LIST_CASE(type, name, camel_name) \ |
| 1586 if (o == heap->name()) n = #camel_name; | 1586 if (n == NULL && o == heap->name()) n = #camel_name; |
| 1587 #define STRUCT_LIST_CASE(upper_name, camel_name, name) \ | 1587 #define STRUCT_LIST_CASE(upper_name, camel_name, name) \ |
| 1588 if (o == heap->name##_map()) n = #camel_name "Map"; | 1588 if (n == NULL && o == heap->name##_map()) n = #camel_name "Map"; |
| 1589 i::HeapObjectIterator it(heap->map_space()); | 1589 i::HeapObjectIterator it(heap->map_space()); |
| 1590 printf("KNOWN_MAPS = {\n"); | 1590 printf("KNOWN_MAPS = {\n"); |
| 1591 for (i::Object* o = it.Next(); o != NULL; o = it.Next()) { | 1591 for (i::Object* o = it.Next(); o != NULL; o = it.Next()) { |
| 1592 i::Map* m = i::Map::cast(o); | 1592 i::Map* m = i::Map::cast(o); |
| 1593 const char* n = NULL; | 1593 const char* n = NULL; |
| 1594 intptr_t p = reinterpret_cast<intptr_t>(m) & 0xfffff; | 1594 intptr_t p = reinterpret_cast<intptr_t>(m) & 0xfffff; |
| 1595 int t = m->instance_type(); | 1595 int t = m->instance_type(); |
| 1596 ROOT_LIST(ROOT_LIST_CASE) | 1596 ROOT_LIST(ROOT_LIST_CASE) |
| 1597 STRUCT_LIST(STRUCT_LIST_CASE) | 1597 STRUCT_LIST(STRUCT_LIST_CASE) |
| 1598 if (n == NULL) continue; | 1598 if (n == NULL) continue; |
| 1599 printf(" 0x%05" V8PRIxPTR ": (%d, \"%s\"),\n", p, t, n); | 1599 printf(" 0x%05" V8PRIxPTR ": (%d, \"%s\"),\n", p, t, n); |
| 1600 } | 1600 } |
| 1601 printf("}\n"); | 1601 printf("}\n"); |
| 1602 #undef STRUCT_LIST_CASE | 1602 #undef STRUCT_LIST_CASE |
| 1603 #undef ROOT_LIST_CASE | 1603 #undef ROOT_LIST_CASE |
| 1604 | 1604 |
| 1605 // Dump the KNOWN_OBJECTS table to the console. | 1605 // Dump the KNOWN_OBJECTS table to the console. |
| 1606 printf("\n# List of known V8 objects.\n"); | 1606 printf("\n# List of known V8 objects.\n"); |
| 1607 #define ROOT_LIST_CASE(type, name, camel_name) \ | 1607 #define ROOT_LIST_CASE(type, name, camel_name) \ |
| 1608 if (o == heap->name()) n = #camel_name; | 1608 if (n == NULL && o == heap->name()) n = #camel_name; |
| 1609 i::OldSpaces spit(heap); | 1609 i::OldSpaces spit(heap); |
| 1610 printf("KNOWN_OBJECTS = {\n"); | 1610 printf("KNOWN_OBJECTS = {\n"); |
| 1611 for (i::PagedSpace* s = spit.next(); s != NULL; s = spit.next()) { | 1611 for (i::PagedSpace* s = spit.next(); s != NULL; s = spit.next()) { |
| 1612 i::HeapObjectIterator it(s); | 1612 i::HeapObjectIterator it(s); |
| 1613 const char* sname = AllocationSpaceName(s->identity()); | 1613 const char* sname = AllocationSpaceName(s->identity()); |
| 1614 for (i::Object* o = it.Next(); o != NULL; o = it.Next()) { | 1614 for (i::Object* o = it.Next(); o != NULL; o = it.Next()) { |
| 1615 const char* n = NULL; | 1615 const char* n = NULL; |
| 1616 intptr_t p = reinterpret_cast<intptr_t>(o) & 0xfffff; | 1616 intptr_t p = reinterpret_cast<intptr_t>(o) & 0xfffff; |
| 1617 ROOT_LIST(ROOT_LIST_CASE) | 1617 ROOT_LIST(ROOT_LIST_CASE) |
| 1618 if (n == NULL) continue; | 1618 if (n == NULL) continue; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1732 } | 1732 } |
| 1733 | 1733 |
| 1734 } // namespace v8 | 1734 } // namespace v8 |
| 1735 | 1735 |
| 1736 | 1736 |
| 1737 #ifndef GOOGLE3 | 1737 #ifndef GOOGLE3 |
| 1738 int main(int argc, char* argv[]) { | 1738 int main(int argc, char* argv[]) { |
| 1739 return v8::Shell::Main(argc, argv); | 1739 return v8::Shell::Main(argc, argv); |
| 1740 } | 1740 } |
| 1741 #endif | 1741 #endif |
| OLD | NEW |