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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 import re | 49 import re |
50 import sys | 50 import sys |
51 | 51 |
52 # | 52 # |
53 # Miscellaneous constants such as tags and masks used for object identification, | 53 # Miscellaneous constants such as tags and masks used for object identification, |
54 # enumeration values used as indexes in internal tables, etc.. | 54 # enumeration values used as indexes in internal tables, etc.. |
55 # | 55 # |
56 consts_misc = [ | 56 consts_misc = [ |
57 { 'name': 'FirstNonstringType', 'value': 'FIRST_NONSTRING_TYPE' }, | 57 { 'name': 'FirstNonstringType', 'value': 'FIRST_NONSTRING_TYPE' }, |
| 58 { 'name': 'APIObjectType', 'value': 'JS_API_OBJECT_TYPE' }, |
| 59 { 'name': 'SpecialAPIObjectType', 'value': 'JS_SPECIAL_API_OBJECT_TYPE' }, |
58 | 60 |
59 { 'name': 'IsNotStringMask', 'value': 'kIsNotStringMask' }, | 61 { 'name': 'IsNotStringMask', 'value': 'kIsNotStringMask' }, |
60 { 'name': 'StringTag', 'value': 'kStringTag' }, | 62 { 'name': 'StringTag', 'value': 'kStringTag' }, |
61 { 'name': 'NotStringTag', 'value': 'kNotStringTag' }, | 63 { 'name': 'NotStringTag', 'value': 'kNotStringTag' }, |
62 | 64 |
63 { 'name': 'StringEncodingMask', 'value': 'kStringEncodingMask' }, | 65 { 'name': 'StringEncodingMask', 'value': 'kStringEncodingMask' }, |
64 { 'name': 'TwoByteStringTag', 'value': 'kTwoByteStringTag' }, | 66 { 'name': 'TwoByteStringTag', 'value': 'kTwoByteStringTag' }, |
65 { 'name': 'OneByteStringTag', 'value': 'kOneByteStringTag' }, | 67 { 'name': 'OneByteStringTag', 'value': 'kOneByteStringTag' }, |
66 | 68 |
67 { 'name': 'StringRepresentationMask', | 69 { 'name': 'StringRepresentationMask', |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 # Please note that extra accessors should _only_ be added to expose offsets that | 220 # Please note that extra accessors should _only_ be added to expose offsets that |
219 # can be used to access actual V8 objects' properties. They should not be added | 221 # can be used to access actual V8 objects' properties. They should not be added |
220 # for exposing other values. For instance, enumeration values or class' | 222 # for exposing other values. For instance, enumeration values or class' |
221 # constants should be exposed by adding an entry in the "consts_misc" table, not | 223 # constants should be exposed by adding an entry in the "consts_misc" table, not |
222 # in this "extras_accessors" table. | 224 # in this "extras_accessors" table. |
223 # | 225 # |
224 extras_accessors = [ | 226 extras_accessors = [ |
225 'JSFunction, context, Context, kContextOffset', | 227 'JSFunction, context, Context, kContextOffset', |
226 'HeapObject, map, Map, kMapOffset', | 228 'HeapObject, map, Map, kMapOffset', |
227 'JSObject, elements, Object, kElementsOffset', | 229 'JSObject, elements, Object, kElementsOffset', |
| 230 'JSObject, internal_fields, uintptr_t, kHeaderSize', |
228 'FixedArray, data, uintptr_t, kHeaderSize', | 231 'FixedArray, data, uintptr_t, kHeaderSize', |
229 'JSArrayBuffer, backing_store, Object, kBackingStoreOffset', | 232 'JSArrayBuffer, backing_store, Object, kBackingStoreOffset', |
230 'JSArrayBufferView, byte_offset, Object, kByteOffsetOffset', | 233 'JSArrayBufferView, byte_offset, Object, kByteOffsetOffset', |
231 'JSTypedArray, length, Object, kLengthOffset', | 234 'JSTypedArray, length, Object, kLengthOffset', |
232 'Map, instance_attributes, int, kInstanceAttributesOffset', | 235 'Map, instance_attributes, int, kInstanceAttributesOffset', |
233 'Map, inobject_properties_or_constructor_function_index, int, kInObjectPrope
rtiesOrConstructorFunctionIndexOffset', | 236 'Map, inobject_properties_or_constructor_function_index, int, kInObjectPrope
rtiesOrConstructorFunctionIndexOffset', |
234 'Map, instance_size, int, kInstanceSizeOffset', | 237 'Map, instance_size, int, kInstanceSizeOffset', |
235 'Map, bit_field, char, kBitFieldOffset', | 238 'Map, bit_field, char, kBitFieldOffset', |
236 'Map, bit_field2, char, kBitField2Offset', | 239 'Map, bit_field2, char, kBitField2Offset', |
237 'Map, bit_field3, int, kBitField3Offset', | 240 'Map, bit_field3, int, kBitField3Offset', |
(...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 | 630 |
628 out.write(footer); | 631 out.write(footer); |
629 | 632 |
630 if (len(sys.argv) < 4): | 633 if (len(sys.argv) < 4): |
631 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); | 634 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); |
632 sys.exit(2); | 635 sys.exit(2); |
633 | 636 |
634 load_objects(); | 637 load_objects(); |
635 load_fields(); | 638 load_fields(); |
636 emit_config(); | 639 emit_config(); |
OLD | NEW |