v8/tools/v8heapconst.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

450 lines
19 KiB
Python
Raw Normal View History

# Copyright 2019 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can
# be found in the LICENSE file.
# This file is automatically generated by mkgrokdump and should not
# be modified manually.
# List of known V8 instance types.
INSTANCE_TYPES = {
0: "INTERNALIZED_STRING_TYPE",
2: "EXTERNAL_INTERNALIZED_STRING_TYPE",
8: "ONE_BYTE_INTERNALIZED_STRING_TYPE",
10: "EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE",
18: "UNCACHED_EXTERNAL_INTERNALIZED_STRING_TYPE",
26: "UNCACHED_EXTERNAL_ONE_BYTE_INTERNALIZED_STRING_TYPE",
32: "STRING_TYPE",
33: "CONS_STRING_TYPE",
34: "EXTERNAL_STRING_TYPE",
35: "SLICED_STRING_TYPE",
37: "THIN_STRING_TYPE",
40: "ONE_BYTE_STRING_TYPE",
41: "CONS_ONE_BYTE_STRING_TYPE",
42: "EXTERNAL_ONE_BYTE_STRING_TYPE",
43: "SLICED_ONE_BYTE_STRING_TYPE",
45: "THIN_ONE_BYTE_STRING_TYPE",
50: "UNCACHED_EXTERNAL_STRING_TYPE",
58: "UNCACHED_EXTERNAL_ONE_BYTE_STRING_TYPE",
64: "SYMBOL_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
65: "BIG_INT_BASE_TYPE",
66: "HEAP_NUMBER_TYPE",
67: "ODDBALL_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
68: "SOURCE_TEXT_MODULE_TYPE",
69: "SYNTHETIC_MODULE_TYPE",
70: "FOREIGN_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
71: "PROMISE_FULFILL_REACTION_JOB_TASK_TYPE",
72: "PROMISE_REJECT_REACTION_JOB_TASK_TYPE",
73: "CALLABLE_TASK_TYPE",
74: "CALLBACK_TASK_TYPE",
75: "PROMISE_RESOLVE_THENABLE_JOB_TASK_TYPE",
76: "LOAD_HANDLER_TYPE",
77: "STORE_HANDLER_TYPE",
78: "FUNCTION_TEMPLATE_INFO_TYPE",
79: "OBJECT_TEMPLATE_INFO_TYPE",
[torque] Use generated instance types, part 1 This change begins making use of the fact that Torque now knows about the relationship between classes and instance types, to replace a few repetitive lists: - Instance type checkers (single and range), defined in src/objects/instance-type.h - Verification dispatch in src/diagnostics/objects-debug.cc - Printer dispatch in src/diagnostics/objects-printer.cc - Postmortem object type detection in tools/debug_helper/get-object-properties.cc Torque is updated to generate four macro lists for the instance types, representing all of the classes separated in two dimensions: classes that correspond to a single instance type versus those that have a range, and classes that are fully defined in Torque (with fields and methods inside '{}') versus those that are only declared. The latter distinction is useful because fully-defined classes are guaranteed to correspond to real C++ classes, whereas only-declared classes are not. A few other changes were required to make the lists above work: - Renamed IsFiller to IsFreeSpaceOrFiller to better reflect what it does and avoid conflicts with the new macro-generated IsFiller method. This is the part I'm most worried about: I think the new name is an improvement for clarity and consistency, but I could imagine someone typing IsFiller out of habit and introducing a bug. If we'd prefer to keep the name IsFiller, my other idea is to rename FreeSpace to VariableSizeFiller and Filler to FixedSizeFiller. - Made Tuple3 extend from Struct, not Tuple2, because IsTuple2 is expected to check for only TUPLE2_TYPE and not include TUPLE3_TYPE. - Normalized the dispatched behavior for BigIntBase and HeapNumber. - Added a few new object printers. Bug: v8:7793 Change-Id: I5462bb105f8a314baa59bd6ab6ab6215df6f313c Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1860314 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Jakob Kummerow <jkummerow@chromium.org> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Dan Elphick <delphick@chromium.org> Reviewed-by: Ulan Degenbaev <ulan@chromium.org> Cr-Commit-Position: refs/heads/master@{#64597}
2019-10-28 17:42:41 +00:00
80: "ACCESS_CHECK_INFO_TYPE",
81: "ACCESSOR_INFO_TYPE",
82: "ACCESSOR_PAIR_TYPE",
83: "ALIASED_ARGUMENTS_ENTRY_TYPE",
84: "ALLOCATION_MEMENTO_TYPE",
85: "ALLOCATION_SITE_TYPE",
86: "ARRAY_BOILERPLATE_DESCRIPTION_TYPE",
87: "ASM_WASM_DATA_TYPE",
88: "ASYNC_GENERATOR_REQUEST_TYPE",
89: "CALL_HANDLER_INFO_TYPE",
90: "CLASS_POSITIONS_TYPE",
91: "DEBUG_INFO_TYPE",
92: "ENUM_CACHE_TYPE",
93: "FEEDBACK_CELL_TYPE",
94: "FUNCTION_TEMPLATE_RARE_DATA_TYPE",
95: "INTERCEPTOR_INFO_TYPE",
96: "INTERNAL_CLASS_TYPE",
97: "INTERPRETER_DATA_TYPE",
98: "PROMISE_CAPABILITY_TYPE",
99: "PROMISE_REACTION_TYPE",
100: "PROTOTYPE_INFO_TYPE",
101: "SCRIPT_TYPE",
102: "SMI_BOX_TYPE",
103: "SMI_PAIR_TYPE",
104: "SORT_STATE_TYPE",
105: "SOURCE_TEXT_MODULE_INFO_ENTRY_TYPE",
106: "STACK_FRAME_INFO_TYPE",
107: "STACK_TRACE_FRAME_TYPE",
108: "TEMPLATE_OBJECT_DESCRIPTION_TYPE",
109: "TUPLE2_TYPE",
110: "TUPLE3_TYPE",
111: "WASM_CAPI_FUNCTION_DATA_TYPE",
112: "WASM_DEBUG_INFO_TYPE",
113: "WASM_EXCEPTION_TAG_TYPE",
114: "WASM_EXPORTED_FUNCTION_DATA_TYPE",
115: "WASM_INDIRECT_FUNCTION_TABLE_TYPE",
116: "WASM_JS_FUNCTION_DATA_TYPE",
117: "FIXED_ARRAY_TYPE",
118: "HASH_TABLE_TYPE",
119: "EPHEMERON_HASH_TABLE_TYPE",
120: "GLOBAL_DICTIONARY_TYPE",
121: "NAME_DICTIONARY_TYPE",
122: "NUMBER_DICTIONARY_TYPE",
123: "ORDERED_HASH_MAP_TYPE",
124: "ORDERED_HASH_SET_TYPE",
125: "ORDERED_NAME_DICTIONARY_TYPE",
126: "SIMPLE_NUMBER_DICTIONARY_TYPE",
127: "STRING_TABLE_TYPE",
128: "CLOSURE_FEEDBACK_CELL_ARRAY_TYPE",
129: "OBJECT_BOILERPLATE_DESCRIPTION_TYPE",
130: "SCOPE_INFO_TYPE",
131: "SCRIPT_CONTEXT_TABLE_TYPE",
132: "BYTE_ARRAY_TYPE",
133: "BYTECODE_ARRAY_TYPE",
134: "FIXED_DOUBLE_ARRAY_TYPE",
135: "AWAIT_CONTEXT_TYPE",
136: "BLOCK_CONTEXT_TYPE",
137: "CATCH_CONTEXT_TYPE",
138: "DEBUG_EVALUATE_CONTEXT_TYPE",
139: "EVAL_CONTEXT_TYPE",
140: "FUNCTION_CONTEXT_TYPE",
141: "MODULE_CONTEXT_TYPE",
142: "NATIVE_CONTEXT_TYPE",
143: "SCRIPT_CONTEXT_TYPE",
144: "WITH_CONTEXT_TYPE",
145: "SMALL_ORDERED_HASH_MAP_TYPE",
146: "SMALL_ORDERED_HASH_SET_TYPE",
147: "SMALL_ORDERED_NAME_DICTIONARY_TYPE",
148: "UNCOMPILED_DATA_WITH_PREPARSE_DATA_TYPE",
149: "UNCOMPILED_DATA_WITHOUT_PREPARSE_DATA_TYPE",
150: "WEAK_FIXED_ARRAY_TYPE",
151: "TRANSITION_ARRAY_TYPE",
152: "CELL_TYPE",
153: "CODE_TYPE",
154: "CODE_DATA_CONTAINER_TYPE",
155: "DESCRIPTOR_ARRAY_TYPE",
156: "EMBEDDER_DATA_ARRAY_TYPE",
157: "FEEDBACK_METADATA_TYPE",
158: "FEEDBACK_VECTOR_TYPE",
159: "FILLER_TYPE",
160: "FREE_SPACE_TYPE",
161: "MAP_TYPE",
162: "PREPARSE_DATA_TYPE",
163: "PROPERTY_ARRAY_TYPE",
164: "PROPERTY_CELL_TYPE",
165: "SHARED_FUNCTION_INFO_TYPE",
166: "WEAK_ARRAY_LIST_TYPE",
167: "WEAK_CELL_TYPE",
168: "JS_PROXY_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
1057: "JS_OBJECT_TYPE",
169: "JS_GLOBAL_OBJECT_TYPE",
170: "JS_GLOBAL_PROXY_TYPE",
171: "JS_MODULE_NAMESPACE_TYPE",
1040: "JS_SPECIAL_API_OBJECT_TYPE",
1041: "JS_PRIMITIVE_WRAPPER_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
1042: "JS_MAP_KEY_ITERATOR_TYPE",
1043: "JS_MAP_KEY_VALUE_ITERATOR_TYPE",
1044: "JS_MAP_VALUE_ITERATOR_TYPE",
1045: "JS_SET_KEY_VALUE_ITERATOR_TYPE",
1046: "JS_SET_VALUE_ITERATOR_TYPE",
1047: "JS_GENERATOR_OBJECT_TYPE",
1048: "JS_ASYNC_FUNCTION_OBJECT_TYPE",
1049: "JS_ASYNC_GENERATOR_OBJECT_TYPE",
1050: "JS_DATA_VIEW_TYPE",
1051: "JS_TYPED_ARRAY_TYPE",
1052: "JS_MAP_TYPE",
1053: "JS_SET_TYPE",
1054: "JS_WEAK_MAP_TYPE",
1055: "JS_WEAK_SET_TYPE",
1056: "JS_API_OBJECT_TYPE",
1058: "JS_ARGUMENTS_OBJECT_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
1059: "JS_ARRAY_TYPE",
1060: "JS_ARRAY_BUFFER_TYPE",
1061: "JS_ARRAY_ITERATOR_TYPE",
[es2015] Refactor the JSArrayIterator. This changes the JSArrayIterator to always have only a single instance type, instead of the zoo of instance types that we had before, and which became less useful with the specification update to when "next" is loaded from the iterator now. This greatly simplifies the baseline implementation of the array iterator, which now only looks at the iterated object during %ArrayIteratorPrototype%.next invocations. In TurboFan we introduce a new JSCreateArrayIterator operator, that holds the IterationKind and get's the iterated object as input. When optimizing %ArrayIteratorPrototype%.next in the JSCallReducer, we check whether the receiver is a JSCreateArrayIterator, and if so, we try to infer maps for the iterated object from there. If we find any, we speculatively assume that these won't have changed during iteration (as we did before with the previous approach), and generate fast code for both JSArray and JSTypedArray iteration. Drive-by-fix: Drop the fast_array_iteration protector, it's not necessary anymore since we have the deoptimization guard bit in the JSCallReducer now. This addresses the performance cliff noticed in webpack 4. The minimal repro on the tracking bug goes from console.timeEnd: mono, 124.773000 console.timeEnd: poly, 670.353000 to console.timeEnd: mono, 118.709000 console.timeEnd: poly, 141.393000 so that's a 4.7x improvement. Also make presubmit happy by adding the missing #undef's. Bug: v8:7510, v7:7514 Change-Id: I79a46bfa2cd0f0710e09365ef72519b1bbb667b5 Reviewed-on: https://chromium-review.googlesource.com/946098 Reviewed-by: Sigurd Schneider <sigurds@chromium.org> Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/master@{#51725}
2018-03-02 19:31:01 +00:00
1062: "JS_ASYNC_FROM_SYNC_ITERATOR_TYPE",
[torque] Generate instance types Design doc: https://docs.google.com/document/d/1ZU6rCvF2YHBGMLujWqqaxlPsjFfjKDE9C3-EugfdlAE/edit Changes from the design doc: - Changed to use 'class' declarations rather than 'type' declarations for things that need instance types but whose layout is not known to Torque. These declarations end with a semicolon rather than having a full set of methods and fields surrounded by {}. If the class's name should not be treated as a class name in generated output (because it's actually a template, or doesn't exist at all), we use the standard 'generates' clause to declare the most appropriate C++ class. - Removed @instanceTypeName. - @highestInstanceType became @highestInstanceTypeWithinParentClassRange to indicate a semantic change: it no longer denotes the highest instance type globally, but only within the range of values for its immediate parent class. This lets us use it for Oddball, which is expected to be the highest primitive type. - Added new abstract classes JSCustomElementsObject and JSSpecialObject to help with some range checks. - Added @lowestInstanceTypeWithinParentClassRange so we can move the new classes JSCustomElementsObject and JSSpecialObject to the beginning of the JSObject range. This seems like the least-brittle way to establish ranges that also include JSProxy (and these ranges are verified with static assertions in instance-type.h). - Renamed @instanceTypeValue to @apiExposedInstanceTypeValue. - Renamed @instanceTypeFlags to @reserveBitsInInstanceType. This change introduces the new annotations and adds the ability for Torque to assign instance types that satisfy those annotations. Torque now emits two new macros: - TORQUE_ASSIGNED_INSTANCE_TYPES, which is used to define the InstanceType enumeration - TORQUE_ASSIGNED_INSTANCE_TYPE_LIST, which replaces the non-String parts of INSTANCE_TYPE_LIST The design document mentions a couple of other macro lists that could easily be replaced, but I'd like to defer those to a subsequent checkin because this one is already pretty large. Bug: v8:7793 Change-Id: Ie71d93a9d5b610e62be0ffa3bb36180c3357a6e8 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1757094 Commit-Queue: Seth Brenith <seth.brenith@microsoft.com> Reviewed-by: Tobias Tebbi <tebbi@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Sathya Gunasekaran <gsathya@chromium.org> Cr-Commit-Position: refs/heads/master@{#64258}
2019-10-11 21:52:06 +00:00
1063: "JS_COLLATOR_TYPE",
1064: "JS_CONTEXT_EXTENSION_OBJECT_TYPE",
1065: "JS_DATE_TYPE",
1066: "JS_DATE_TIME_FORMAT_TYPE",
1067: "JS_DISPLAY_NAMES_TYPE",
1068: "JS_ERROR_TYPE",
1069: "JS_FINALIZATION_GROUP_TYPE",
1070: "JS_FINALIZATION_GROUP_CLEANUP_ITERATOR_TYPE",
1071: "JS_LIST_FORMAT_TYPE",
1072: "JS_LOCALE_TYPE",
1073: "JS_MESSAGE_OBJECT_TYPE",
1074: "JS_NUMBER_FORMAT_TYPE",
1075: "JS_PLURAL_RULES_TYPE",
1076: "JS_PROMISE_TYPE",
1077: "JS_REG_EXP_TYPE",
1078: "JS_REG_EXP_STRING_ITERATOR_TYPE",
1079: "JS_RELATIVE_TIME_FORMAT_TYPE",
1080: "JS_SEGMENT_ITERATOR_TYPE",
1081: "JS_SEGMENTER_TYPE",
1082: "JS_STRING_ITERATOR_TYPE",
1083: "JS_V8_BREAK_ITERATOR_TYPE",
1084: "JS_WEAK_REF_TYPE",
1085: "WASM_EXCEPTION_OBJECT_TYPE",
1086: "WASM_GLOBAL_OBJECT_TYPE",
1087: "WASM_INSTANCE_OBJECT_TYPE",
1088: "WASM_MEMORY_OBJECT_TYPE",
1089: "WASM_MODULE_OBJECT_TYPE",
1090: "WASM_TABLE_OBJECT_TYPE",
1091: "JS_BOUND_FUNCTION_TYPE",
1092: "JS_FUNCTION_TYPE",
}
# List of known V8 maps.
KNOWN_MAPS = {
("read_only_space", 0x00121): (160, "FreeSpaceMap"),
("read_only_space", 0x00149): (161, "MetaMap"),
("read_only_space", 0x0018d): (67, "NullMap"),
("read_only_space", 0x001c5): (155, "DescriptorArrayMap"),
("read_only_space", 0x001f5): (150, "WeakFixedArrayMap"),
("read_only_space", 0x0021d): (159, "OnePointerFillerMap"),
("read_only_space", 0x00245): (159, "TwoPointerFillerMap"),
("read_only_space", 0x00289): (67, "UninitializedMap"),
("read_only_space", 0x002cd): (8, "OneByteInternalizedStringMap"),
("read_only_space", 0x00329): (67, "UndefinedMap"),
("read_only_space", 0x0035d): (66, "HeapNumberMap"),
("read_only_space", 0x003a1): (67, "TheHoleMap"),
("read_only_space", 0x00401): (67, "BooleanMap"),
("read_only_space", 0x00489): (132, "ByteArrayMap"),
("read_only_space", 0x004b1): (117, "FixedArrayMap"),
("read_only_space", 0x004d9): (117, "FixedCOWArrayMap"),
("read_only_space", 0x00501): (118, "HashTableMap"),
("read_only_space", 0x00529): (64, "SymbolMap"),
("read_only_space", 0x00551): (40, "OneByteStringMap"),
("read_only_space", 0x00579): (130, "ScopeInfoMap"),
("read_only_space", 0x005a1): (165, "SharedFunctionInfoMap"),
("read_only_space", 0x005c9): (153, "CodeMap"),
("read_only_space", 0x005f1): (152, "CellMap"),
("read_only_space", 0x00619): (164, "GlobalPropertyCellMap"),
("read_only_space", 0x00641): (70, "ForeignMap"),
("read_only_space", 0x00669): (151, "TransitionArrayMap"),
("read_only_space", 0x00691): (45, "ThinOneByteStringMap"),
("read_only_space", 0x006b9): (158, "FeedbackVectorMap"),
("read_only_space", 0x0070d): (67, "ArgumentsMarkerMap"),
("read_only_space", 0x0076d): (67, "ExceptionMap"),
("read_only_space", 0x007c9): (67, "TerminationExceptionMap"),
("read_only_space", 0x00831): (67, "OptimizedOutMap"),
("read_only_space", 0x00891): (67, "StaleRegisterMap"),
("read_only_space", 0x008d5): (131, "ScriptContextTableMap"),
("read_only_space", 0x008fd): (128, "ClosureFeedbackCellArrayMap"),
("read_only_space", 0x00925): (157, "FeedbackMetadataArrayMap"),
("read_only_space", 0x0094d): (117, "ArrayListMap"),
("read_only_space", 0x00975): (65, "BigIntMap"),
("read_only_space", 0x0099d): (129, "ObjectBoilerplateDescriptionMap"),
("read_only_space", 0x009c5): (133, "BytecodeArrayMap"),
("read_only_space", 0x009ed): (154, "CodeDataContainerMap"),
("read_only_space", 0x00a15): (134, "FixedDoubleArrayMap"),
("read_only_space", 0x00a3d): (120, "GlobalDictionaryMap"),
("read_only_space", 0x00a65): (93, "ManyClosuresCellMap"),
("read_only_space", 0x00a8d): (117, "ModuleInfoMap"),
("read_only_space", 0x00ab5): (121, "NameDictionaryMap"),
("read_only_space", 0x00add): (93, "NoClosuresCellMap"),
("read_only_space", 0x00b05): (122, "NumberDictionaryMap"),
("read_only_space", 0x00b2d): (93, "OneClosureCellMap"),
("read_only_space", 0x00b55): (123, "OrderedHashMapMap"),
("read_only_space", 0x00b7d): (124, "OrderedHashSetMap"),
("read_only_space", 0x00ba5): (125, "OrderedNameDictionaryMap"),
("read_only_space", 0x00bcd): (162, "PreparseDataMap"),
("read_only_space", 0x00bf5): (163, "PropertyArrayMap"),
("read_only_space", 0x00c1d): (89, "SideEffectCallHandlerInfoMap"),
("read_only_space", 0x00c45): (89, "SideEffectFreeCallHandlerInfoMap"),
("read_only_space", 0x00c6d): (89, "NextCallSideEffectFreeCallHandlerInfoMap"),
("read_only_space", 0x00c95): (126, "SimpleNumberDictionaryMap"),
("read_only_space", 0x00cbd): (117, "SloppyArgumentsElementsMap"),
("read_only_space", 0x00ce5): (145, "SmallOrderedHashMapMap"),
("read_only_space", 0x00d0d): (146, "SmallOrderedHashSetMap"),
("read_only_space", 0x00d35): (147, "SmallOrderedNameDictionaryMap"),
("read_only_space", 0x00d5d): (68, "SourceTextModuleMap"),
("read_only_space", 0x00d85): (127, "StringTableMap"),
("read_only_space", 0x00dad): (69, "SyntheticModuleMap"),
("read_only_space", 0x00dd5): (149, "UncompiledDataWithoutPreparseDataMap"),
("read_only_space", 0x00dfd): (148, "UncompiledDataWithPreparseDataMap"),
("read_only_space", 0x00e25): (166, "WeakArrayListMap"),
("read_only_space", 0x00e4d): (119, "EphemeronHashTableMap"),
("read_only_space", 0x00e75): (156, "EmbedderDataArrayMap"),
("read_only_space", 0x00e9d): (167, "WeakCellMap"),
("read_only_space", 0x00ec5): (32, "StringMap"),
("read_only_space", 0x00eed): (41, "ConsOneByteStringMap"),
("read_only_space", 0x00f15): (33, "ConsStringMap"),
("read_only_space", 0x00f3d): (37, "ThinStringMap"),
("read_only_space", 0x00f65): (35, "SlicedStringMap"),
("read_only_space", 0x00f8d): (43, "SlicedOneByteStringMap"),
("read_only_space", 0x00fb5): (34, "ExternalStringMap"),
("read_only_space", 0x00fdd): (42, "ExternalOneByteStringMap"),
("read_only_space", 0x01005): (50, "UncachedExternalStringMap"),
("read_only_space", 0x0102d): (0, "InternalizedStringMap"),
("read_only_space", 0x01055): (2, "ExternalInternalizedStringMap"),
("read_only_space", 0x0107d): (10, "ExternalOneByteInternalizedStringMap"),
("read_only_space", 0x010a5): (18, "UncachedExternalInternalizedStringMap"),
("read_only_space", 0x010cd): (26, "UncachedExternalOneByteInternalizedStringMap"),
("read_only_space", 0x010f5): (58, "UncachedExternalOneByteStringMap"),
("read_only_space", 0x0111d): (67, "SelfReferenceMarkerMap"),
("read_only_space", 0x01151): (92, "EnumCacheMap"),
("read_only_space", 0x011a1): (86, "ArrayBoilerplateDescriptionMap"),
("read_only_space", 0x0129d): (95, "InterceptorInfoMap"),
("read_only_space", 0x03289): (71, "PromiseFulfillReactionJobTaskMap"),
("read_only_space", 0x032b1): (72, "PromiseRejectReactionJobTaskMap"),
("read_only_space", 0x032d9): (73, "CallableTaskMap"),
("read_only_space", 0x03301): (74, "CallbackTaskMap"),
("read_only_space", 0x03329): (75, "PromiseResolveThenableJobTaskMap"),
("read_only_space", 0x03351): (78, "FunctionTemplateInfoMap"),
("read_only_space", 0x03379): (79, "ObjectTemplateInfoMap"),
("read_only_space", 0x033a1): (80, "AccessCheckInfoMap"),
("read_only_space", 0x033c9): (81, "AccessorInfoMap"),
("read_only_space", 0x033f1): (82, "AccessorPairMap"),
("read_only_space", 0x03419): (83, "AliasedArgumentsEntryMap"),
("read_only_space", 0x03441): (84, "AllocationMementoMap"),
("read_only_space", 0x03469): (87, "AsmWasmDataMap"),
("read_only_space", 0x03491): (88, "AsyncGeneratorRequestMap"),
("read_only_space", 0x034b9): (90, "ClassPositionsMap"),
("read_only_space", 0x034e1): (91, "DebugInfoMap"),
("read_only_space", 0x03509): (94, "FunctionTemplateRareDataMap"),
("read_only_space", 0x03531): (97, "InterpreterDataMap"),
("read_only_space", 0x03559): (98, "PromiseCapabilityMap"),
("read_only_space", 0x03581): (99, "PromiseReactionMap"),
("read_only_space", 0x035a9): (100, "PrototypeInfoMap"),
("read_only_space", 0x035d1): (101, "ScriptMap"),
("read_only_space", 0x035f9): (105, "SourceTextModuleInfoEntryMap"),
("read_only_space", 0x03621): (106, "StackFrameInfoMap"),
("read_only_space", 0x03649): (107, "StackTraceFrameMap"),
("read_only_space", 0x03671): (108, "TemplateObjectDescriptionMap"),
("read_only_space", 0x03699): (109, "Tuple2Map"),
("read_only_space", 0x036c1): (110, "Tuple3Map"),
("read_only_space", 0x036e9): (111, "WasmCapiFunctionDataMap"),
("read_only_space", 0x03711): (112, "WasmDebugInfoMap"),
("read_only_space", 0x03739): (113, "WasmExceptionTagMap"),
("read_only_space", 0x03761): (114, "WasmExportedFunctionDataMap"),
("read_only_space", 0x03789): (115, "WasmIndirectFunctionTableMap"),
("read_only_space", 0x037b1): (116, "WasmJSFunctionDataMap"),
("read_only_space", 0x037d9): (96, "InternalClassMap"),
("read_only_space", 0x03801): (103, "SmiPairMap"),
("read_only_space", 0x03829): (102, "SmiBoxMap"),
("read_only_space", 0x03851): (104, "SortStateMap"),
("read_only_space", 0x03879): (85, "AllocationSiteWithWeakNextMap"),
("read_only_space", 0x038a1): (85, "AllocationSiteWithoutWeakNextMap"),
("read_only_space", 0x038c9): (76, "LoadHandler1Map"),
("read_only_space", 0x038f1): (76, "LoadHandler2Map"),
("read_only_space", 0x03919): (76, "LoadHandler3Map"),
("read_only_space", 0x03941): (77, "StoreHandler0Map"),
("read_only_space", 0x03969): (77, "StoreHandler1Map"),
("read_only_space", 0x03991): (77, "StoreHandler2Map"),
("read_only_space", 0x039b9): (77, "StoreHandler3Map"),
("map_space", 0x00121): (1057, "ExternalMap"),
("map_space", 0x00149): (1073, "JSMessageObjectMap"),
}
# List of known V8 objects.
KNOWN_OBJECTS = {
("read_only_space", 0x00171): "NullValue",
("read_only_space", 0x001b5): "EmptyDescriptorArray",
("read_only_space", 0x001ed): "EmptyWeakFixedArray",
("read_only_space", 0x0026d): "UninitializedValue",
("read_only_space", 0x0030d): "UndefinedValue",
("read_only_space", 0x00351): "NanValue",
("read_only_space", 0x00385): "TheHoleValue",
("read_only_space", 0x003d9): "HoleNanValue",
("read_only_space", 0x003e5): "TrueValue",
("read_only_space", 0x0044d): "FalseValue",
("read_only_space", 0x0047d): "empty_string",
("read_only_space", 0x006e1): "EmptyScopeInfo",
("read_only_space", 0x006e9): "EmptyFixedArray",
("read_only_space", 0x006f1): "ArgumentsMarker",
("read_only_space", 0x00751): "Exception",
("read_only_space", 0x007ad): "TerminationException",
("read_only_space", 0x00815): "OptimizedOut",
("read_only_space", 0x00875): "StaleRegister",
("read_only_space", 0x01145): "EmptyEnumCache",
("read_only_space", 0x01179): "EmptyPropertyArray",
("read_only_space", 0x01181): "EmptyByteArray",
("read_only_space", 0x01189): "EmptyObjectBoilerplateDescription",
("read_only_space", 0x01195): "EmptyArrayBoilerplateDescription",
("read_only_space", 0x011c9): "EmptyClosureFeedbackCellArray",
("read_only_space", 0x011d1): "EmptySloppyArgumentsElements",
("read_only_space", 0x011e1): "EmptySlowElementDictionary",
("read_only_space", 0x01205): "EmptyOrderedHashMap",
("read_only_space", 0x01219): "EmptyOrderedHashSet",
("read_only_space", 0x0122d): "EmptyFeedbackMetadata",
("read_only_space", 0x01239): "EmptyPropertyCell",
("read_only_space", 0x0124d): "EmptyPropertyDictionary",
("read_only_space", 0x01275): "NoOpInterceptorInfo",
("read_only_space", 0x012c5): "EmptyWeakArrayList",
("read_only_space", 0x012d1): "InfinityValue",
("read_only_space", 0x012dd): "MinusZeroValue",
("read_only_space", 0x012e9): "MinusInfinityValue",
("read_only_space", 0x012f5): "SelfReferenceMarker",
("read_only_space", 0x01335): "OffHeapTrampolineRelocationInfo",
("read_only_space", 0x01341): "TrampolineTrivialCodeDataContainer",
("read_only_space", 0x0134d): "TrampolinePromiseRejectionCodeDataContainer",
("read_only_space", 0x01359): "GlobalThisBindingScopeInfo",
("read_only_space", 0x01391): "EmptyFunctionScopeInfo",
("read_only_space", 0x013b9): "NativeScopeInfo",
("read_only_space", 0x013d5): "HashSeed",
("old_space", 0x00121): "ArgumentsIteratorAccessor",
("old_space", 0x00165): "ArrayLengthAccessor",
("old_space", 0x001a9): "BoundFunctionLengthAccessor",
("old_space", 0x001ed): "BoundFunctionNameAccessor",
("old_space", 0x00231): "ErrorStackAccessor",
("old_space", 0x00275): "FunctionArgumentsAccessor",
("old_space", 0x002b9): "FunctionCallerAccessor",
("old_space", 0x002fd): "FunctionNameAccessor",
("old_space", 0x00341): "FunctionLengthAccessor",
("old_space", 0x00385): "FunctionPrototypeAccessor",
("old_space", 0x003c9): "RegExpResultIndicesAccessor",
("old_space", 0x0040d): "StringLengthAccessor",
("old_space", 0x00451): "InvalidPrototypeValidityCell",
("old_space", 0x00459): "EmptyScript",
("old_space", 0x00499): "ManyClosuresCell",
("old_space", 0x004a5): "ArrayConstructorProtector",
("old_space", 0x004b9): "NoElementsProtector",
("old_space", 0x004cd): "IsConcatSpreadableProtector",
("old_space", 0x004e1): "ArraySpeciesProtector",
("old_space", 0x004f5): "TypedArraySpeciesProtector",
("old_space", 0x00509): "PromiseSpeciesProtector",
("old_space", 0x0051d): "StringLengthProtector",
("old_space", 0x00531): "ArrayIteratorProtector",
("old_space", 0x00545): "ArrayBufferDetachingProtector",
("old_space", 0x00559): "PromiseHookProtector",
("old_space", 0x0056d): "PromiseResolveProtector",
("old_space", 0x00581): "MapIteratorProtector",
("old_space", 0x00595): "PromiseThenProtector",
("old_space", 0x005a9): "SetIteratorProtector",
("old_space", 0x005bd): "StringIteratorProtector",
("old_space", 0x005d1): "SingleCharacterStringCache",
("old_space", 0x009d9): "StringSplitCache",
("old_space", 0x00de1): "RegExpMultipleCache",
("old_space", 0x011e9): "BuiltinsConstantsTable",
}
# Lower 32 bits of first page addresses for various heap spaces.
HEAP_FIRST_PAGES = {
0x08100000: "old_space",
0x08140000: "map_space",
0x08040000: "read_only_space",
}
# List of known V8 Frame Markers.
FRAME_MARKERS = (
"ENTRY",
"CONSTRUCT_ENTRY",
"EXIT",
"OPTIMIZED",
"WASM_COMPILED",
"WASM_TO_JS",
"JS_TO_WASM",
"WASM_INTERPRETER_ENTRY",
"C_WASM_ENTRY",
"WASM_EXIT",
"WASM_COMPILE_LAZY",
"INTERPRETED",
"STUB",
"BUILTIN_CONTINUATION",
"JAVA_SCRIPT_BUILTIN_CONTINUATION",
"JAVA_SCRIPT_BUILTIN_CONTINUATION_WITH_CATCH",
"INTERNAL",
"CONSTRUCT",
"ARGUMENTS_ADAPTOR",
"BUILTIN",
"BUILTIN_EXIT",
"NATIVE",
)
# This set of constants is generated from a shipping build.