Reduce max instance type enum value.

We collect instance type statistics in FatalProcessOutOfMemory into an
array, which is allocated to the max instance type value. While we want
to leave space to ensure new instance types do not affect constants in
the API, we can be more frugal.

We currently serialize 350 maps into the startup/context snapshot.  Even
if we assign a distinct instance type to each of these maps, we would
still have more than enough to spare with this change.

R=ulan@chromium.org

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng
Change-Id: I3e583c2c8da3342e9132d96046b5d80cd41afd72
Reviewed-on: https://chromium-review.googlesource.com/842542
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50302}
This commit is contained in:
Yang Guo 2017-12-22 18:20:47 +01:00 committed by Commit Bot
parent a067281d39
commit c8736f6899
3 changed files with 81 additions and 81 deletions

View File

@ -9083,9 +9083,9 @@ class Internals {
static const int kFirstNonstringType = 0x80;
static const int kOddballType = 0x83;
static const int kForeignType = 0x87;
static const int kJSSpecialApiObjectType = 0x8100;
static const int kJSApiObjectType = 0x8200;
static const int kJSObjectType = 0x8201;
static const int kJSSpecialApiObjectType = 0x410;
static const int kJSApiObjectType = 0x420;
static const int kJSObjectType = 0x421;
static const int kUndefinedOddballKind = 5;
static const int kNullOddballKind = 3;

View File

@ -767,16 +767,16 @@ enum InstanceType : uint16_t {
// Some of the following instance types are exposed in v8.h, so to not
// unnecessarily change the ABI when we introduce new instance types in the
// future, we leave some space between instance types.
JS_PROXY_TYPE = 0x8000, // FIRST_JS_RECEIVER_TYPE
JS_PROXY_TYPE = 0x0400, // FIRST_JS_RECEIVER_TYPE
JS_GLOBAL_OBJECT_TYPE, // FIRST_JS_OBJECT_TYPE
JS_GLOBAL_PROXY_TYPE,
JS_MODULE_NAMESPACE_TYPE,
// Like JS_API_OBJECT_TYPE, but requires access checks and/or has
// interceptors.
JS_SPECIAL_API_OBJECT_TYPE = 0x8100, // LAST_SPECIAL_RECEIVER_TYPE
JS_SPECIAL_API_OBJECT_TYPE = 0x0410, // LAST_SPECIAL_RECEIVER_TYPE
JS_VALUE_TYPE, // LAST_CUSTOM_ELEMENTS_RECEIVER
// Like JS_OBJECT_TYPE, but created from API function.
JS_API_OBJECT_TYPE = 0x8200,
JS_API_OBJECT_TYPE = 0x0420,
JS_OBJECT_TYPE,
JS_ARGUMENTS_TYPE,
JS_ARRAY_BUFFER_TYPE,

View File

@ -87,79 +87,79 @@ INSTANCE_TYPES = {
183: "SMALL_ORDERED_HASH_SET_TYPE",
184: "STORE_HANDLER_TYPE",
185: "WEAK_CELL_TYPE",
32768: "JS_PROXY_TYPE",
32769: "JS_GLOBAL_OBJECT_TYPE",
32770: "JS_GLOBAL_PROXY_TYPE",
32771: "JS_MODULE_NAMESPACE_TYPE",
33024: "JS_SPECIAL_API_OBJECT_TYPE",
33025: "JS_VALUE_TYPE",
33280: "JS_API_OBJECT_TYPE",
33281: "JS_OBJECT_TYPE",
33282: "JS_ARGUMENTS_TYPE",
33283: "JS_ARRAY_BUFFER_TYPE",
33284: "JS_ARRAY_TYPE",
33285: "JS_ASYNC_FROM_SYNC_ITERATOR_TYPE",
33286: "JS_ASYNC_GENERATOR_OBJECT_TYPE",
33287: "JS_CONTEXT_EXTENSION_OBJECT_TYPE",
33288: "JS_DATE_TYPE",
33289: "JS_ERROR_TYPE",
33290: "JS_GENERATOR_OBJECT_TYPE",
33291: "JS_MAP_TYPE",
33292: "JS_MAP_KEY_ITERATOR_TYPE",
33293: "JS_MAP_KEY_VALUE_ITERATOR_TYPE",
33294: "JS_MAP_VALUE_ITERATOR_TYPE",
33295: "JS_MESSAGE_OBJECT_TYPE",
33296: "JS_PROMISE_TYPE",
33297: "JS_REGEXP_TYPE",
33298: "JS_SET_TYPE",
33299: "JS_SET_KEY_VALUE_ITERATOR_TYPE",
33300: "JS_SET_VALUE_ITERATOR_TYPE",
33301: "JS_STRING_ITERATOR_TYPE",
33302: "JS_WEAK_MAP_TYPE",
33303: "JS_WEAK_SET_TYPE",
33304: "JS_TYPED_ARRAY_TYPE",
33305: "JS_DATA_VIEW_TYPE",
33306: "JS_TYPED_ARRAY_KEY_ITERATOR_TYPE",
33307: "JS_FAST_ARRAY_KEY_ITERATOR_TYPE",
33308: "JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE",
33309: "JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33310: "JS_INT8_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33311: "JS_UINT16_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33312: "JS_INT16_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33313: "JS_UINT32_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33314: "JS_INT32_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33315: "JS_FLOAT32_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33316: "JS_FLOAT64_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33317: "JS_UINT8_CLAMPED_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33318: "JS_FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33319: "JS_FAST_HOLEY_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33320: "JS_FAST_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33321: "JS_FAST_HOLEY_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33322: "JS_FAST_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33323: "JS_FAST_HOLEY_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33324: "JS_GENERIC_ARRAY_KEY_VALUE_ITERATOR_TYPE",
33325: "JS_UINT8_ARRAY_VALUE_ITERATOR_TYPE",
33326: "JS_INT8_ARRAY_VALUE_ITERATOR_TYPE",
33327: "JS_UINT16_ARRAY_VALUE_ITERATOR_TYPE",
33328: "JS_INT16_ARRAY_VALUE_ITERATOR_TYPE",
33329: "JS_UINT32_ARRAY_VALUE_ITERATOR_TYPE",
33330: "JS_INT32_ARRAY_VALUE_ITERATOR_TYPE",
33331: "JS_FLOAT32_ARRAY_VALUE_ITERATOR_TYPE",
33332: "JS_FLOAT64_ARRAY_VALUE_ITERATOR_TYPE",
33333: "JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE",
33334: "JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE",
33335: "JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE",
33336: "JS_FAST_ARRAY_VALUE_ITERATOR_TYPE",
33337: "JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE",
33338: "JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE",
33339: "JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE",
33340: "JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE",
33341: "WASM_INSTANCE_TYPE",
33342: "WASM_MEMORY_TYPE",
33343: "WASM_MODULE_TYPE",
33344: "WASM_TABLE_TYPE",
33345: "JS_BOUND_FUNCTION_TYPE",
33346: "JS_FUNCTION_TYPE",
1024: "JS_PROXY_TYPE",
1025: "JS_GLOBAL_OBJECT_TYPE",
1026: "JS_GLOBAL_PROXY_TYPE",
1027: "JS_MODULE_NAMESPACE_TYPE",
1040: "JS_SPECIAL_API_OBJECT_TYPE",
1041: "JS_VALUE_TYPE",
1056: "JS_API_OBJECT_TYPE",
1057: "JS_OBJECT_TYPE",
1058: "JS_ARGUMENTS_TYPE",
1059: "JS_ARRAY_BUFFER_TYPE",
1060: "JS_ARRAY_TYPE",
1061: "JS_ASYNC_FROM_SYNC_ITERATOR_TYPE",
1062: "JS_ASYNC_GENERATOR_OBJECT_TYPE",
1063: "JS_CONTEXT_EXTENSION_OBJECT_TYPE",
1064: "JS_DATE_TYPE",
1065: "JS_ERROR_TYPE",
1066: "JS_GENERATOR_OBJECT_TYPE",
1067: "JS_MAP_TYPE",
1068: "JS_MAP_KEY_ITERATOR_TYPE",
1069: "JS_MAP_KEY_VALUE_ITERATOR_TYPE",
1070: "JS_MAP_VALUE_ITERATOR_TYPE",
1071: "JS_MESSAGE_OBJECT_TYPE",
1072: "JS_PROMISE_TYPE",
1073: "JS_REGEXP_TYPE",
1074: "JS_SET_TYPE",
1075: "JS_SET_KEY_VALUE_ITERATOR_TYPE",
1076: "JS_SET_VALUE_ITERATOR_TYPE",
1077: "JS_STRING_ITERATOR_TYPE",
1078: "JS_WEAK_MAP_TYPE",
1079: "JS_WEAK_SET_TYPE",
1080: "JS_TYPED_ARRAY_TYPE",
1081: "JS_DATA_VIEW_TYPE",
1082: "JS_TYPED_ARRAY_KEY_ITERATOR_TYPE",
1083: "JS_FAST_ARRAY_KEY_ITERATOR_TYPE",
1084: "JS_GENERIC_ARRAY_KEY_ITERATOR_TYPE",
1085: "JS_UINT8_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1086: "JS_INT8_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1087: "JS_UINT16_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1088: "JS_INT16_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1089: "JS_UINT32_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1090: "JS_INT32_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1091: "JS_FLOAT32_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1092: "JS_FLOAT64_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1093: "JS_UINT8_CLAMPED_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1094: "JS_FAST_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1095: "JS_FAST_HOLEY_SMI_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1096: "JS_FAST_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1097: "JS_FAST_HOLEY_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1098: "JS_FAST_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1099: "JS_FAST_HOLEY_DOUBLE_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1100: "JS_GENERIC_ARRAY_KEY_VALUE_ITERATOR_TYPE",
1101: "JS_UINT8_ARRAY_VALUE_ITERATOR_TYPE",
1102: "JS_INT8_ARRAY_VALUE_ITERATOR_TYPE",
1103: "JS_UINT16_ARRAY_VALUE_ITERATOR_TYPE",
1104: "JS_INT16_ARRAY_VALUE_ITERATOR_TYPE",
1105: "JS_UINT32_ARRAY_VALUE_ITERATOR_TYPE",
1106: "JS_INT32_ARRAY_VALUE_ITERATOR_TYPE",
1107: "JS_FLOAT32_ARRAY_VALUE_ITERATOR_TYPE",
1108: "JS_FLOAT64_ARRAY_VALUE_ITERATOR_TYPE",
1109: "JS_UINT8_CLAMPED_ARRAY_VALUE_ITERATOR_TYPE",
1110: "JS_FAST_SMI_ARRAY_VALUE_ITERATOR_TYPE",
1111: "JS_FAST_HOLEY_SMI_ARRAY_VALUE_ITERATOR_TYPE",
1112: "JS_FAST_ARRAY_VALUE_ITERATOR_TYPE",
1113: "JS_FAST_HOLEY_ARRAY_VALUE_ITERATOR_TYPE",
1114: "JS_FAST_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE",
1115: "JS_FAST_HOLEY_DOUBLE_ARRAY_VALUE_ITERATOR_TYPE",
1116: "JS_GENERIC_ARRAY_VALUE_ITERATOR_TYPE",
1117: "WASM_INSTANCE_TYPE",
1118: "WASM_MEMORY_TYPE",
1119: "WASM_MODULE_TYPE",
1120: "WASM_TABLE_TYPE",
1121: "JS_BOUND_FUNCTION_TYPE",
1122: "JS_FUNCTION_TYPE",
}
# List of known V8 maps.
@ -219,8 +219,8 @@ KNOWN_MAPS = {
0x03241: (182, "SmallOrderedHashMapMap"),
0x03291: (183, "SmallOrderedHashSetMap"),
0x032e1: (176, "CodeDataContainerMap"),
0x03331: (33295, "JSMessageObjectMap"),
0x03381: (33281, "ExternalMap"),
0x03331: (1071, "JSMessageObjectMap"),
0x03381: (1057, "ExternalMap"),
0x033d1: (137, "BytecodeArrayMap"),
0x03421: (171, "ModuleInfoMap"),
0x03471: (175, "NoClosuresCellMap"),