OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2012 the V8 project authors. All rights reserved. | 3 # Copyright 2012 the V8 project authors. All rights reserved. |
4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
6 # met: | 6 # met: |
7 # | 7 # |
8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 146: "FILLER_TYPE", | 871 146: "FILLER_TYPE", |
872 147: "ACCESSOR_INFO_TYPE", | 872 147: "ACCESSOR_INFO_TYPE", |
873 148: "ACCESSOR_PAIR_TYPE", | 873 148: "ACCESSOR_PAIR_TYPE", |
874 149: "ACCESS_CHECK_INFO_TYPE", | 874 149: "ACCESS_CHECK_INFO_TYPE", |
875 150: "INTERCEPTOR_INFO_TYPE", | 875 150: "INTERCEPTOR_INFO_TYPE", |
876 151: "CALL_HANDLER_INFO_TYPE", | 876 151: "CALL_HANDLER_INFO_TYPE", |
877 152: "FUNCTION_TEMPLATE_INFO_TYPE", | 877 152: "FUNCTION_TEMPLATE_INFO_TYPE", |
878 153: "OBJECT_TEMPLATE_INFO_TYPE", | 878 153: "OBJECT_TEMPLATE_INFO_TYPE", |
879 154: "SIGNATURE_INFO_TYPE", | 879 154: "SIGNATURE_INFO_TYPE", |
880 155: "TYPE_SWITCH_INFO_TYPE", | 880 155: "TYPE_SWITCH_INFO_TYPE", |
881 156: "SCRIPT_TYPE", | 881 156: "ALLOCATION_SITE_INFO_TYPE", |
882 157: "CODE_CACHE_TYPE", | 882 157: "SCRIPT_TYPE", |
883 158: "POLYMORPHIC_CODE_CACHE_TYPE", | 883 158: "CODE_CACHE_TYPE", |
884 159: "TYPE_FEEDBACK_INFO_TYPE", | 884 159: "POLYMORPHIC_CODE_CACHE_TYPE", |
885 160: "ALIASED_ARGUMENTS_ENTRY_TYPE", | 885 160: "TYPE_FEEDBACK_INFO_TYPE", |
886 163: "FIXED_ARRAY_TYPE", | 886 161: "ALIASED_ARGUMENTS_ENTRY_TYPE", |
| 887 164: "FIXED_ARRAY_TYPE", |
887 145: "FIXED_DOUBLE_ARRAY_TYPE", | 888 145: "FIXED_DOUBLE_ARRAY_TYPE", |
888 164: "SHARED_FUNCTION_INFO_TYPE", | 889 165: "SHARED_FUNCTION_INFO_TYPE", |
889 165: "JS_MESSAGE_OBJECT_TYPE", | 890 166: "JS_MESSAGE_OBJECT_TYPE", |
890 168: "JS_VALUE_TYPE", | 891 169: "JS_VALUE_TYPE", |
891 169: "JS_DATE_TYPE", | 892 170: "JS_DATE_TYPE", |
892 170: "JS_OBJECT_TYPE", | 893 171: "JS_OBJECT_TYPE", |
893 171: "JS_CONTEXT_EXTENSION_OBJECT_TYPE", | 894 172: "JS_CONTEXT_EXTENSION_OBJECT_TYPE", |
894 172: "JS_MODULE_TYPE", | 895 173: "JS_MODULE_TYPE", |
895 173: "JS_GLOBAL_OBJECT_TYPE", | 896 174: "JS_GLOBAL_OBJECT_TYPE", |
896 174: "JS_BUILTINS_OBJECT_TYPE", | 897 175: "JS_BUILTINS_OBJECT_TYPE", |
897 175: "JS_GLOBAL_PROXY_TYPE", | 898 176: "JS_GLOBAL_PROXY_TYPE", |
898 176: "JS_ARRAY_TYPE", | 899 177: "JS_ARRAY_TYPE", |
899 167: "JS_PROXY_TYPE", | 900 168: "JS_PROXY_TYPE", |
900 179: "JS_WEAK_MAP_TYPE", | 901 180: "JS_WEAK_MAP_TYPE", |
901 180: "JS_REGEXP_TYPE", | 902 181: "JS_REGEXP_TYPE", |
902 181: "JS_FUNCTION_TYPE", | 903 182: "JS_FUNCTION_TYPE", |
903 166: "JS_FUNCTION_PROXY_TYPE", | 904 167: "JS_FUNCTION_PROXY_TYPE", |
904 161: "DEBUG_INFO_TYPE", | 905 162: "DEBUG_INFO_TYPE", |
905 162: "BREAK_POINT_INFO_TYPE", | 906 163: "BREAK_POINT_INFO_TYPE", |
906 } | 907 } |
907 | 908 |
908 | 909 |
909 # List of known V8 maps. Used to determine the instance type and name | 910 # List of known V8 maps. Used to determine the instance type and name |
910 # for maps that are part of the root-set and hence on the first page of | 911 # for maps that are part of the root-set and hence on the first page of |
911 # the map-space. Obtained by adding the code below to an IA32 release | 912 # the map-space. Obtained by adding the code below to an IA32 release |
912 # build with enabled snapshots to the end of the Isolate::Init method. | 913 # build with enabled snapshots to the end of the Isolate::Init method. |
913 # | 914 # |
914 # #define ROOT_LIST_CASE(type, name, camel_name) \ | 915 # #define ROOT_LIST_CASE(type, name, camel_name) \ |
915 # if (o == heap_.name()) n = #camel_name; | 916 # if (o == heap_.name()) n = #camel_name; |
916 # #define STRUCT_LIST_CASE(upper_name, camel_name, name) \ | 917 # #define STRUCT_LIST_CASE(upper_name, camel_name, name) \ |
917 # if (o == heap_.name##_map()) n = #camel_name "Map"; | 918 # if (o == heap_.name##_map()) n = #camel_name "Map"; |
918 # HeapObjectIterator it(heap_.map_space()); | 919 # HeapObjectIterator it(heap_.map_space()); |
919 # printf("KNOWN_MAPS = {\n"); | 920 # printf("KNOWN_MAPS = {\n"); |
920 # for (Object* o = it.Next(); o != NULL; o = it.Next()) { | 921 # for (Object* o = it.Next(); o != NULL; o = it.Next()) { |
921 # Map* m = Map::cast(o); | 922 # Map* m = Map::cast(o); |
922 # const char* n = ""; | 923 # const char* n = ""; |
923 # intptr_t p = reinterpret_cast<intptr_t>(m) & 0xfffff; | 924 # intptr_t p = reinterpret_cast<intptr_t>(m) & 0xfffff; |
924 # int t = m->instance_type(); | 925 # int t = m->instance_type(); |
925 # ROOT_LIST(ROOT_LIST_CASE) | 926 # ROOT_LIST(ROOT_LIST_CASE) |
926 # STRUCT_LIST(STRUCT_LIST_CASE) | 927 # STRUCT_LIST(STRUCT_LIST_CASE) |
927 # printf(" 0x%05x: (%d, \"%s\"),\n", p, t, n); | 928 # printf(" 0x%05x: (%d, \"%s\"),\n", p, t, n); |
928 # } | 929 # } |
929 # printf("}\n"); | 930 # printf("}\n"); |
930 KNOWN_MAPS = { | 931 KNOWN_MAPS = { |
931 0x08081: (128, "MetaMap"), | 932 0x08081: (134, "ByteArrayMap"), |
932 0x080a5: (163, "FixedArrayMap"), | 933 0x080a9: (128, "MetaMap"), |
933 0x080c9: (130, "OddballMap"), | 934 0x080d1: (130, "OddballMap"), |
934 0x080ed: (163, "FixedCOWArrayMap"), | 935 0x080f9: (68, "AsciiSymbolMap"), |
935 0x08111: (163, "ScopeInfoMap"), | 936 0x08121: (164, "FixedArrayMap"), |
936 0x08135: (132, "HeapNumberMap"), | 937 0x08149: (132, "HeapNumberMap"), |
937 0x08159: (133, "ForeignMap"), | 938 0x08171: (135, "FreeSpaceMap"), |
938 0x0817d: (64, "SymbolMap"), | 939 0x08199: (146, "OnePointerFillerMap"), |
939 0x081a1: (68, "AsciiSymbolMap"), | 940 0x081c1: (146, "TwoPointerFillerMap"), |
940 0x081c5: (65, "ConsSymbolMap"), | 941 0x081e9: (131, "GlobalPropertyCellMap"), |
941 0x081e9: (69, "ConsAsciiSymbolMap"), | 942 0x08211: (165, "SharedFunctionInfoMap"), |
942 0x0820d: (66, "ExternalSymbolMap"), | 943 0x08239: (4, "AsciiStringMap"), |
943 0x08231: (74, "ExternalSymbolWithAsciiDataMap"), | 944 0x08261: (164, "NativeContextMap"), |
944 0x08255: (70, "ExternalAsciiSymbolMap"), | 945 0x08289: (129, "CodeMap"), |
945 0x08279: (82, "ShortExternalSymbolMap"), | 946 0x082b1: (164, "ScopeInfoMap"), |
946 0x0829d: (90, "ShortExternalSymbolWithAsciiDataMap"), | 947 0x082d9: (164, "FixedCOWArrayMap"), |
947 0x082c1: (86, "ShortExternalAsciiSymbolMap"), | 948 0x08301: (145, "FixedDoubleArrayMap"), |
948 0x082e5: (0, "StringMap"), | 949 0x08329: (164, "HashTableMap"), |
949 0x08309: (4, "AsciiStringMap"), | 950 0x08351: (0, "StringMap"), |
950 0x0832d: (1, "ConsStringMap"), | 951 0x08379: (64, "SymbolMap"), |
951 0x08351: (5, "ConsAsciiStringMap"), | 952 0x083a1: (1, "ConsStringMap"), |
952 0x08375: (3, "SlicedStringMap"), | 953 0x083c9: (5, "ConsAsciiStringMap"), |
953 0x08399: (7, "SlicedAsciiStringMap"), | 954 0x083f1: (3, "SlicedStringMap"), |
954 0x083bd: (2, "ExternalStringMap"), | 955 0x08419: (7, "SlicedAsciiStringMap"), |
955 0x083e1: (10, "ExternalStringWithAsciiDataMap"), | 956 0x08441: (65, "ConsSymbolMap"), |
956 0x08405: (6, "ExternalAsciiStringMap"), | 957 0x08469: (69, "ConsAsciiSymbolMap"), |
957 0x08429: (18, "ShortExternalStringMap"), | 958 0x08491: (66, "ExternalSymbolMap"), |
958 0x0844d: (26, "ShortExternalStringWithAsciiDataMap"), | 959 0x084b9: (74, "ExternalSymbolWithAsciiDataMap"), |
959 0x08471: (22, "ShortExternalAsciiStringMap"), | 960 0x084e1: (70, "ExternalAsciiSymbolMap"), |
960 0x08495: (0, "UndetectableStringMap"), | 961 0x08509: (2, "ExternalStringMap"), |
961 0x084b9: (4, "UndetectableAsciiStringMap"), | 962 0x08531: (10, "ExternalStringWithAsciiDataMap"), |
962 0x084dd: (145, "FixedDoubleArrayMap"), | 963 0x08559: (6, "ExternalAsciiStringMap"), |
963 0x08501: (134, "ByteArrayMap"), | 964 0x08581: (82, "ShortExternalSymbolMap"), |
964 0x08525: (135, "FreeSpaceMap"), | 965 0x085a9: (90, "ShortExternalSymbolWithAsciiDataMap"), |
965 0x08549: (144, "ExternalPixelArrayMap"), | 966 0x085d1: (86, "ShortExternalAsciiSymbolMap"), |
966 0x0856d: (136, "ExternalByteArrayMap"), | 967 0x085f9: (18, "ShortExternalStringMap"), |
967 0x08591: (137, "ExternalUnsignedByteArrayMap"), | 968 0x08621: (26, "ShortExternalStringWithAsciiDataMap"), |
968 0x085b5: (138, "ExternalShortArrayMap"), | 969 0x08649: (22, "ShortExternalAsciiStringMap"), |
969 0x085d9: (139, "ExternalUnsignedShortArrayMap"), | 970 0x08671: (0, "UndetectableStringMap"), |
970 0x085fd: (140, "ExternalIntArrayMap"), | 971 0x08699: (4, "UndetectableAsciiStringMap"), |
971 0x08621: (141, "ExternalUnsignedIntArrayMap"), | 972 0x086c1: (144, "ExternalPixelArrayMap"), |
972 0x08645: (142, "ExternalFloatArrayMap"), | 973 0x086e9: (136, "ExternalByteArrayMap"), |
973 0x08669: (163, "NonStrictArgumentsElementsMap"), | 974 0x08711: (137, "ExternalUnsignedByteArrayMap"), |
974 0x0868d: (143, "ExternalDoubleArrayMap"), | 975 0x08739: (138, "ExternalShortArrayMap"), |
975 0x086b1: (129, "CodeMap"), | 976 0x08761: (139, "ExternalUnsignedShortArrayMap"), |
976 0x086d5: (131, "GlobalPropertyCellMap"), | 977 0x08789: (140, "ExternalIntArrayMap"), |
977 0x086f9: (146, "OnePointerFillerMap"), | 978 0x087b1: (141, "ExternalUnsignedIntArrayMap"), |
978 0x0871d: (146, "TwoPointerFillerMap"), | 979 0x087d9: (142, "ExternalFloatArrayMap"), |
979 0x08741: (147, "AccessorInfoMap"), | 980 0x08801: (143, "ExternalDoubleArrayMap"), |
980 0x08765: (148, "AccessorPairMap"), | 981 0x08829: (164, "NonStrictArgumentsElementsMap"), |
981 0x08789: (149, "AccessCheckInfoMap"), | 982 0x08851: (164, "FunctionContextMap"), |
982 0x087ad: (150, "InterceptorInfoMap"), | 983 0x08879: (164, "CatchContextMap"), |
983 0x087d1: (151, "CallHandlerInfoMap"), | 984 0x088a1: (164, "WithContextMap"), |
984 0x087f5: (152, "FunctionTemplateInfoMap"), | 985 0x088c9: (164, "BlockContextMap"), |
985 0x08819: (153, "ObjectTemplateInfoMap"), | 986 0x088f1: (164, "ModuleContextMap"), |
986 0x0883d: (154, "SignatureInfoMap"), | 987 0x08919: (164, "GlobalContextMap"), |
987 0x08861: (155, "TypeSwitchInfoMap"), | 988 0x08941: (166, "JSMessageObjectMap"), |
988 0x08885: (156, "ScriptMap"), | 989 0x08969: (133, "ForeignMap"), |
989 0x088a9: (157, "CodeCacheMap"), | 990 0x08991: (171, "NeanderMap"), |
990 0x088cd: (158, "PolymorphicCodeCacheMap"), | 991 0x089b9: (156, "AllocationSiteInfoMap"), |
991 0x088f1: (159, "TypeFeedbackInfoMap"), | 992 0x089e1: (159, "PolymorphicCodeCacheMap"), |
992 0x08915: (160, "AliasedArgumentsEntryMap"), | 993 0x08a09: (157, "ScriptMap"), |
993 0x08939: (161, "DebugInfoMap"), | 994 0x08a31: (171, ""), |
994 0x0895d: (162, "BreakPointInfoMap"), | 995 0x08a59: (171, "ExternalMap"), |
995 0x08981: (163, "HashTableMap"), | 996 0x08a81: (147, "AccessorInfoMap"), |
996 0x089a5: (163, "FunctionContextMap"), | 997 0x08aa9: (148, "AccessorPairMap"), |
997 0x089c9: (163, "CatchContextMap"), | 998 0x08ad1: (149, "AccessCheckInfoMap"), |
998 0x089ed: (163, "WithContextMap"), | 999 0x08af9: (150, "InterceptorInfoMap"), |
999 0x08a11: (163, "BlockContextMap"), | 1000 0x08b21: (151, "CallHandlerInfoMap"), |
1000 0x08a35: (163, "ModuleContextMap"), | 1001 0x08b49: (152, "FunctionTemplateInfoMap"), |
1001 0x08a59: (163, "GlobalContextMap"), | 1002 0x08b71: (153, "ObjectTemplateInfoMap"), |
1002 0x08a7d: (163, "NativeContextMap"), | 1003 0x08b99: (154, "SignatureInfoMap"), |
1003 0x08aa1: (164, "SharedFunctionInfoMap"), | 1004 0x08bc1: (155, "TypeSwitchInfoMap"), |
1004 0x08ac5: (165, "JSMessageObjectMap"), | 1005 0x08be9: (158, "CodeCacheMap"), |
1005 0x08ae9: (170, "ExternalMap"), | 1006 0x08c11: (160, "TypeFeedbackInfoMap"), |
1006 0x08b0d: (170, "NeanderMap"), | 1007 0x08c39: (161, "AliasedArgumentsEntryMap"), |
1007 0x08b31: (170, ""), | 1008 0x08c61: (162, "DebugInfoMap"), |
| 1009 0x08c89: (163, "BreakPointInfoMap"), |
1008 } | 1010 } |
1009 | 1011 |
1010 | 1012 |
1011 # List of known V8 objects. Used to determine name for objects that are | 1013 # List of known V8 objects. Used to determine name for objects that are |
1012 # part of the root-set and hence on the first page of various old-space | 1014 # part of the root-set and hence on the first page of various old-space |
1013 # paged. Obtained by adding the code below to an IA32 release build with | 1015 # paged. Obtained by adding the code below to an IA32 release build with |
1014 # enabled snapshots to the end of the Isolate::Init method. | 1016 # enabled snapshots to the end of the Isolate::Init method. |
1015 # | 1017 # |
1016 # #define ROOT_LIST_CASE(type, name, camel_name) \ | 1018 # #define ROOT_LIST_CASE(type, name, camel_name) \ |
1017 # if (o == heap_.name()) n = #camel_name; | 1019 # if (o == heap_.name()) n = #camel_name; |
(...skipping 904 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 options, args = parser.parse_args() | 1924 options, args = parser.parse_args() |
1923 if os.path.exists(options.objdump): | 1925 if os.path.exists(options.objdump): |
1924 disasm.OBJDUMP_BIN = options.objdump | 1926 disasm.OBJDUMP_BIN = options.objdump |
1925 OBJDUMP_BIN = options.objdump | 1927 OBJDUMP_BIN = options.objdump |
1926 else: | 1928 else: |
1927 print "Cannot find %s, falling back to default objdump" % options.objdump | 1929 print "Cannot find %s, falling back to default objdump" % options.objdump |
1928 if len(args) != 1: | 1930 if len(args) != 1: |
1929 parser.print_help() | 1931 parser.print_help() |
1930 sys.exit(1) | 1932 sys.exit(1) |
1931 AnalyzeMinidump(options, args[0]) | 1933 AnalyzeMinidump(options, args[0]) |
OLD | NEW |