OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # | 3 # |
4 # Copyright 2012 the V8 project authors. All rights reserved. | 4 # Copyright 2012 the V8 project authors. All rights reserved. |
5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
7 # met: | 7 # met: |
8 # | 8 # |
9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 { 'name': 'prop_idx_first', | 91 { 'name': 'prop_idx_first', |
92 'value': 'DescriptorArray::kFirstIndex' }, | 92 'value': 'DescriptorArray::kFirstIndex' }, |
93 { 'name': 'prop_type_field', | 93 { 'name': 'prop_type_field', |
94 'value': 'DATA' }, | 94 'value': 'DATA' }, |
95 { 'name': 'prop_type_mask', | 95 { 'name': 'prop_type_mask', |
96 'value': 'PropertyDetails::TypeField::kMask' }, | 96 'value': 'PropertyDetails::TypeField::kMask' }, |
97 { 'name': 'prop_index_mask', | 97 { 'name': 'prop_index_mask', |
98 'value': 'PropertyDetails::FieldIndexField::kMask' }, | 98 'value': 'PropertyDetails::FieldIndexField::kMask' }, |
99 { 'name': 'prop_index_shift', | 99 { 'name': 'prop_index_shift', |
100 'value': 'PropertyDetails::FieldIndexField::kShift' }, | 100 'value': 'PropertyDetails::FieldIndexField::kShift' }, |
| 101 { 'name': 'prop_representation_mask', |
| 102 'value': 'PropertyDetails::RepresentationField::kMask' }, |
| 103 { 'name': 'prop_representation_shift', |
| 104 'value': 'PropertyDetails::RepresentationField::kShift' }, |
| 105 { 'name': 'prop_representation_integer8', |
| 106 'value': 'Representation::Kind::kInteger8' }, |
| 107 { 'name': 'prop_representation_uinteger8', |
| 108 'value': 'Representation::Kind::kUInteger8' }, |
| 109 { 'name': 'prop_representation_integer16', |
| 110 'value': 'Representation::Kind::kInteger16' }, |
| 111 { 'name': 'prop_representation_uinteger16', |
| 112 'value': 'Representation::Kind::kUInteger16' }, |
| 113 { 'name': 'prop_representation_smi', |
| 114 'value': 'Representation::Kind::kSmi' }, |
| 115 { 'name': 'prop_representation_integer32', |
| 116 'value': 'Representation::Kind::kInteger32' }, |
| 117 { 'name': 'prop_representation_double', |
| 118 'value': 'Representation::Kind::kDouble' }, |
| 119 { 'name': 'prop_representation_heapobject', |
| 120 'value': 'Representation::Kind::kHeapObject' }, |
| 121 { 'name': 'prop_representation_tagged', |
| 122 'value': 'Representation::Kind::kTagged' }, |
| 123 { 'name': 'prop_representation_external', |
| 124 'value': 'Representation::Kind::kExternal' }, |
101 | 125 |
102 { 'name': 'prop_desc_key', | 126 { 'name': 'prop_desc_key', |
103 'value': 'DescriptorArray::kDescriptorKey' }, | 127 'value': 'DescriptorArray::kDescriptorKey' }, |
104 { 'name': 'prop_desc_details', | 128 { 'name': 'prop_desc_details', |
105 'value': 'DescriptorArray::kDescriptorDetails' }, | 129 'value': 'DescriptorArray::kDescriptorDetails' }, |
106 { 'name': 'prop_desc_value', | 130 { 'name': 'prop_desc_value', |
107 'value': 'DescriptorArray::kDescriptorValue' }, | 131 'value': 'DescriptorArray::kDescriptorValue' }, |
108 { 'name': 'prop_desc_size', | 132 { 'name': 'prop_desc_size', |
109 'value': 'DescriptorArray::kDescriptorSize' }, | 133 'value': 'DescriptorArray::kDescriptorSize' }, |
110 | 134 |
111 { 'name': 'elements_fast_holey_elements', | 135 { 'name': 'elements_fast_holey_elements', |
112 'value': 'FAST_HOLEY_ELEMENTS' }, | 136 'value': 'FAST_HOLEY_ELEMENTS' }, |
113 { 'name': 'elements_fast_elements', | 137 { 'name': 'elements_fast_elements', |
114 'value': 'FAST_ELEMENTS' }, | 138 'value': 'FAST_ELEMENTS' }, |
115 { 'name': 'elements_dictionary_elements', | 139 { 'name': 'elements_dictionary_elements', |
116 'value': 'DICTIONARY_ELEMENTS' }, | 140 'value': 'DICTIONARY_ELEMENTS' }, |
117 | 141 |
118 { 'name': 'bit_field2_elements_kind_mask', | 142 { 'name': 'bit_field2_elements_kind_mask', |
119 'value': 'Map::ElementsKindBits::kMask' }, | 143 'value': 'Map::ElementsKindBits::kMask' }, |
120 { 'name': 'bit_field2_elements_kind_shift', | 144 { 'name': 'bit_field2_elements_kind_shift', |
121 'value': 'Map::ElementsKindBits::kShift' }, | 145 'value': 'Map::ElementsKindBits::kShift' }, |
122 { 'name': 'bit_field3_dictionary_map_shift', | 146 { 'name': 'bit_field3_dictionary_map_shift', |
123 'value': 'Map::DictionaryMap::kShift' }, | 147 'value': 'Map::DictionaryMap::kShift' }, |
| 148 { 'name': 'bit_field3_number_of_own_descriptors_mask', |
| 149 'value': 'Map::NumberOfOwnDescriptorsBits::kMask' }, |
| 150 { 'name': 'bit_field3_number_of_own_descriptors_shift', |
| 151 'value': 'Map::NumberOfOwnDescriptorsBits::kShift' }, |
124 | 152 |
125 { 'name': 'off_fp_context', | 153 { 'name': 'off_fp_context', |
126 'value': 'StandardFrameConstants::kContextOffset' }, | 154 'value': 'StandardFrameConstants::kContextOffset' }, |
127 { 'name': 'off_fp_constant_pool', | 155 { 'name': 'off_fp_constant_pool', |
128 'value': 'StandardFrameConstants::kConstantPoolOffset' }, | 156 'value': 'StandardFrameConstants::kConstantPoolOffset' }, |
129 { 'name': 'off_fp_marker', | 157 { 'name': 'off_fp_marker', |
130 'value': 'StandardFrameConstants::kMarkerOffset' }, | 158 'value': 'StandardFrameConstants::kMarkerOffset' }, |
131 { 'name': 'off_fp_function', | 159 { 'name': 'off_fp_function', |
132 'value': 'JavaScriptFrameConstants::kFunctionOffset' }, | 160 'value': 'JavaScriptFrameConstants::kFunctionOffset' }, |
133 { 'name': 'off_fp_args', | 161 { 'name': 'off_fp_args', |
134 'value': 'JavaScriptFrameConstants::kLastParameterOffset' }, | 162 'value': 'JavaScriptFrameConstants::kLastParameterOffset' }, |
135 | 163 |
136 { 'name': 'scopeinfo_idx_nparams', | 164 { 'name': 'scopeinfo_idx_nparams', |
137 'value': 'ScopeInfo::kParameterCount' }, | 165 'value': 'ScopeInfo::kParameterCount' }, |
138 { 'name': 'scopeinfo_idx_nstacklocals', | 166 { 'name': 'scopeinfo_idx_nstacklocals', |
139 'value': 'ScopeInfo::kStackLocalCount' }, | 167 'value': 'ScopeInfo::kStackLocalCount' }, |
140 { 'name': 'scopeinfo_idx_ncontextlocals', | 168 { 'name': 'scopeinfo_idx_ncontextlocals', |
141 'value': 'ScopeInfo::kContextLocalCount' }, | 169 'value': 'ScopeInfo::kContextLocalCount' }, |
| 170 { 'name': 'scopeinfo_idx_ncontextglobals', |
| 171 'value': 'ScopeInfo::kContextLocalCount' }, |
142 { 'name': 'scopeinfo_idx_first_vars', | 172 { 'name': 'scopeinfo_idx_first_vars', |
143 'value': 'ScopeInfo::kVariablePartIndex' }, | 173 'value': 'ScopeInfo::kVariablePartIndex' }, |
| 174 |
| 175 { 'name': 'sharedfunctioninfo_start_position_mask', |
| 176 'value': 'SharedFunctionInfo::kStartPositionMask' }, |
| 177 { 'name': 'sharedfunctioninfo_start_position_shift', |
| 178 'value': 'SharedFunctionInfo::kStartPositionShift' }, |
| 179 |
| 180 { 'name': 'jsarray_buffer_was_neutered_mask', |
| 181 'value': 'JSArrayBuffer::WasNeutered::kMask' }, |
| 182 { 'name': 'jsarray_buffer_was_neutered_shift', |
| 183 'value': 'JSArrayBuffer::WasNeutered::kShift' }, |
144 ]; | 184 ]; |
145 | 185 |
146 # | 186 # |
147 # The following useful fields are missing accessors, so we define fake ones. | 187 # The following useful fields are missing accessors, so we define fake ones. |
148 # | 188 # |
149 extras_accessors = [ | 189 extras_accessors = [ |
| 190 'JSFunction, context, Context, kContextOffset', |
| 191 'Context, closure_index, int, CLOSURE_INDEX', |
| 192 'Context, global_object_index, int, GLOBAL_OBJECT_INDEX', |
| 193 'Context, previous_index, int, PREVIOUS_INDEX', |
| 194 'Context, min_context_slots, int, MIN_CONTEXT_SLOTS', |
150 'HeapObject, map, Map, kMapOffset', | 195 'HeapObject, map, Map, kMapOffset', |
151 'JSObject, elements, Object, kElementsOffset', | 196 'JSObject, elements, Object, kElementsOffset', |
152 'FixedArray, data, uintptr_t, kHeaderSize', | 197 'FixedArray, data, uintptr_t, kHeaderSize', |
153 'JSArrayBuffer, backing_store, Object, kBackingStoreOffset', | 198 'JSArrayBuffer, backing_store, Object, kBackingStoreOffset', |
154 'JSArrayBufferView, byte_offset, Object, kByteOffsetOffset', | 199 'JSArrayBufferView, byte_offset, Object, kByteOffsetOffset', |
155 'JSTypedArray, length, Object, kLengthOffset', | 200 'JSTypedArray, length, Object, kLengthOffset', |
156 'Map, instance_attributes, int, kInstanceAttributesOffset', | 201 'Map, instance_attributes, int, kInstanceAttributesOffset', |
157 'Map, inobject_properties_or_constructor_function_index, int, kInObjectPrope
rtiesOrConstructorFunctionIndexOffset', | 202 'Map, inobject_properties_or_constructor_function_index, int, kInObjectPrope
rtiesOrConstructorFunctionIndexOffset', |
158 'Map, instance_size, int, kInstanceSizeOffset', | 203 'Map, instance_size, int, kInstanceSizeOffset', |
159 'Map, bit_field, char, kBitFieldOffset', | 204 'Map, bit_field, char, kBitFieldOffset', |
160 'Map, bit_field2, char, kBitField2Offset', | 205 'Map, bit_field2, char, kBitField2Offset', |
161 'Map, bit_field3, int, kBitField3Offset', | 206 'Map, bit_field3, int, kBitField3Offset', |
162 'Map, prototype, Object, kPrototypeOffset', | 207 'Map, prototype, Object, kPrototypeOffset', |
163 'NameDictionaryShape, prefix_size, int, kPrefixSize', | 208 'NameDictionaryShape, prefix_size, int, kPrefixSize', |
164 'NameDictionaryShape, entry_size, int, kEntrySize', | 209 'NameDictionaryShape, entry_size, int, kEntrySize', |
| 210 'NameDictionary, prefix_start_index, int, kPrefixStartIndex', |
165 'SeededNumberDictionaryShape, prefix_size, int, kPrefixSize', | 211 'SeededNumberDictionaryShape, prefix_size, int, kPrefixSize', |
166 'UnseededNumberDictionaryShape, prefix_size, int, kPrefixSize', | 212 'UnseededNumberDictionaryShape, prefix_size, int, kPrefixSize', |
167 'NumberDictionaryShape, entry_size, int, kEntrySize', | 213 'NumberDictionaryShape, entry_size, int, kEntrySize', |
168 'Oddball, kind_offset, int, kKindOffset', | 214 'Oddball, kind_offset, int, kKindOffset', |
169 'HeapNumber, value, double, kValueOffset', | 215 'HeapNumber, value, double, kValueOffset', |
170 'ConsString, first, String, kFirstOffset', | 216 'ConsString, first, String, kFirstOffset', |
171 'ConsString, second, String, kSecondOffset', | 217 'ConsString, second, String, kSecondOffset', |
172 'ExternalString, resource, Object, kResourceOffset', | 218 'ExternalString, resource, Object, kResourceOffset', |
173 'SeqOneByteString, chars, char, kHeaderSize', | 219 'SeqOneByteString, chars, char, kHeaderSize', |
174 'SeqTwoByteString, chars, char, kHeaderSize', | 220 'SeqTwoByteString, chars, char, kHeaderSize', |
175 'SharedFunctionInfo, code, Code, kCodeOffset', | 221 'SharedFunctionInfo, code, Code, kCodeOffset', |
| 222 'SharedFunctionInfo, scope_info, ScopeInfo, kScopeInfoOffset', |
176 'SlicedString, parent, String, kParentOffset', | 223 'SlicedString, parent, String, kParentOffset', |
177 'Code, instruction_start, uintptr_t, kHeaderSize', | 224 'Code, instruction_start, uintptr_t, kHeaderSize', |
178 'Code, instruction_size, int, kInstructionSizeOffset', | 225 'Code, instruction_size, int, kInstructionSizeOffset', |
179 ]; | 226 ]; |
180 | 227 |
181 # | 228 # |
182 # The following is a whitelist of classes we expect to find when scanning the | 229 # The following is a whitelist of classes we expect to find when scanning the |
183 # source code. This list is not exhaustive, but it's still useful to identify | 230 # source code. This list is not exhaustive, but it's still useful to identify |
184 # when this script gets out of sync with the source. See load_objects(). | 231 # when this script gets out of sync with the source. See load_objects(). |
185 # | 232 # |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 582 |
536 out.write(footer); | 583 out.write(footer); |
537 | 584 |
538 if (len(sys.argv) < 4): | 585 if (len(sys.argv) < 4): |
539 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); | 586 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); |
540 sys.exit(2); | 587 sys.exit(2); |
541 | 588 |
542 load_objects(); | 589 load_objects(); |
543 load_fields(); | 590 load_fields(); |
544 emit_config(); | 591 emit_config(); |
OLD | NEW |