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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 { 'name': 'StringEncodingMask', 'value': 'kStringEncodingMask' }, | 62 { 'name': 'StringEncodingMask', 'value': 'kStringEncodingMask' }, |
63 { 'name': 'TwoByteStringTag', 'value': 'kTwoByteStringTag' }, | 63 { 'name': 'TwoByteStringTag', 'value': 'kTwoByteStringTag' }, |
64 { 'name': 'AsciiStringTag', 'value': 'kOneByteStringTag' }, | 64 { 'name': 'AsciiStringTag', 'value': 'kOneByteStringTag' }, |
65 | 65 |
66 { 'name': 'StringRepresentationMask', | 66 { 'name': 'StringRepresentationMask', |
67 'value': 'kStringRepresentationMask' }, | 67 'value': 'kStringRepresentationMask' }, |
68 { 'name': 'SeqStringTag', 'value': 'kSeqStringTag' }, | 68 { 'name': 'SeqStringTag', 'value': 'kSeqStringTag' }, |
69 { 'name': 'ConsStringTag', 'value': 'kConsStringTag' }, | 69 { 'name': 'ConsStringTag', 'value': 'kConsStringTag' }, |
70 { 'name': 'ExternalStringTag', 'value': 'kExternalStringTag' }, | 70 { 'name': 'ExternalStringTag', 'value': 'kExternalStringTag' }, |
| 71 { 'name': 'SlicedStringTag', 'value': 'kSlicedStringTag' }, |
71 | 72 |
72 { 'name': 'FailureTag', 'value': 'kFailureTag' }, | 73 { 'name': 'FailureTag', 'value': 'kFailureTag' }, |
73 { 'name': 'FailureTagMask', 'value': 'kFailureTagMask' }, | 74 { 'name': 'FailureTagMask', 'value': 'kFailureTagMask' }, |
74 { 'name': 'HeapObjectTag', 'value': 'kHeapObjectTag' }, | 75 { 'name': 'HeapObjectTag', 'value': 'kHeapObjectTag' }, |
75 { 'name': 'HeapObjectTagMask', 'value': 'kHeapObjectTagMask' }, | 76 { 'name': 'HeapObjectTagMask', 'value': 'kHeapObjectTagMask' }, |
76 { 'name': 'SmiTag', 'value': 'kSmiTag' }, | 77 { 'name': 'SmiTag', 'value': 'kSmiTag' }, |
77 { 'name': 'SmiTagMask', 'value': 'kSmiTagMask' }, | 78 { 'name': 'SmiTagMask', 'value': 'kSmiTagMask' }, |
78 { 'name': 'SmiValueShift', 'value': 'kSmiTagSize' }, | 79 { 'name': 'SmiValueShift', 'value': 'kSmiTagSize' }, |
79 { 'name': 'SmiShiftSize', 'value': 'kSmiShiftSize' }, | 80 { 'name': 'SmiShiftSize', 'value': 'kSmiShiftSize' }, |
80 { 'name': 'PointerSizeLog2', 'value': 'kPointerSizeLog2' }, | 81 { 'name': 'PointerSizeLog2', 'value': 'kPointerSizeLog2' }, |
81 | 82 |
82 { 'name': 'prop_idx_first', | 83 { 'name': 'prop_idx_first', |
83 'value': 'DescriptorArray::kFirstIndex' }, | 84 'value': 'DescriptorArray::kFirstIndex' }, |
84 { 'name': 'prop_type_field', | 85 { 'name': 'prop_type_field', |
85 'value': 'FIELD' }, | 86 'value': 'FIELD' }, |
86 { 'name': 'prop_type_first_phantom', | 87 { 'name': 'prop_type_first_phantom', |
87 'value': 'TRANSITION' }, | 88 'value': 'TRANSITION' }, |
88 { 'name': 'prop_type_mask', | 89 { 'name': 'prop_type_mask', |
89 'value': 'PropertyDetails::TypeField::kMask' }, | 90 'value': 'PropertyDetails::TypeField::kMask' }, |
90 | 91 |
| 92 { 'name': 'prop_desc_key', |
| 93 'value': 'DescriptorArray::kDescriptorKey' }, |
| 94 { 'name': 'prop_desc_details', |
| 95 'value': 'DescriptorArray::kDescriptorDetails' }, |
| 96 { 'name': 'prop_desc_value', |
| 97 'value': 'DescriptorArray::kDescriptorValue' }, |
| 98 { 'name': 'prop_desc_size', |
| 99 'value': 'DescriptorArray::kDescriptorSize' }, |
| 100 |
91 { 'name': 'off_fp_context', | 101 { 'name': 'off_fp_context', |
92 'value': 'StandardFrameConstants::kContextOffset' }, | 102 'value': 'StandardFrameConstants::kContextOffset' }, |
93 { 'name': 'off_fp_marker', | 103 { 'name': 'off_fp_marker', |
94 'value': 'StandardFrameConstants::kMarkerOffset' }, | 104 'value': 'StandardFrameConstants::kMarkerOffset' }, |
95 { 'name': 'off_fp_function', | 105 { 'name': 'off_fp_function', |
96 'value': 'JavaScriptFrameConstants::kFunctionOffset' }, | 106 'value': 'JavaScriptFrameConstants::kFunctionOffset' }, |
97 { 'name': 'off_fp_args', | 107 { 'name': 'off_fp_args', |
98 'value': 'JavaScriptFrameConstants::kLastParameterOffset' }, | 108 'value': 'JavaScriptFrameConstants::kLastParameterOffset' }, |
99 ]; | 109 ]; |
100 | 110 |
101 # | 111 # |
102 # The following useful fields are missing accessors, so we define fake ones. | 112 # The following useful fields are missing accessors, so we define fake ones. |
103 # | 113 # |
104 extras_accessors = [ | 114 extras_accessors = [ |
105 'HeapObject, map, Map, kMapOffset', | 115 'HeapObject, map, Map, kMapOffset', |
106 'JSObject, elements, Object, kElementsOffset', | 116 'JSObject, elements, Object, kElementsOffset', |
107 'FixedArray, data, uintptr_t, kHeaderSize', | 117 'FixedArray, data, uintptr_t, kHeaderSize', |
108 'Map, instance_attributes, int, kInstanceAttributesOffset', | 118 'Map, instance_attributes, int, kInstanceAttributesOffset', |
109 'Map, inobject_properties, int, kInObjectPropertiesOffset', | 119 'Map, inobject_properties, int, kInObjectPropertiesOffset', |
110 'Map, instance_size, int, kInstanceSizeOffset', | 120 'Map, instance_size, int, kInstanceSizeOffset', |
111 'HeapNumber, value, double, kValueOffset', | 121 'HeapNumber, value, double, kValueOffset', |
112 'ConsString, first, String, kFirstOffset', | 122 'ConsString, first, String, kFirstOffset', |
113 'ConsString, second, String, kSecondOffset', | 123 'ConsString, second, String, kSecondOffset', |
114 'ExternalString, resource, Object, kResourceOffset', | 124 'ExternalString, resource, Object, kResourceOffset', |
115 'SeqOneByteString, chars, char, kHeaderSize', | 125 'SeqOneByteString, chars, char, kHeaderSize', |
| 126 'SeqTwoByteString, chars, char, kHeaderSize', |
116 'SharedFunctionInfo, code, Code, kCodeOffset', | 127 'SharedFunctionInfo, code, Code, kCodeOffset', |
| 128 'SlicedString, parent, String, kParentOffset', |
117 'Code, instruction_start, uintptr_t, kHeaderSize', | 129 'Code, instruction_start, uintptr_t, kHeaderSize', |
118 'Code, instruction_size, int, kInstructionSizeOffset', | 130 'Code, instruction_size, int, kInstructionSizeOffset', |
119 ]; | 131 ]; |
120 | 132 |
121 # | 133 # |
122 # The following is a whitelist of classes we expect to find when scanning the | 134 # The following is a whitelist of classes we expect to find when scanning the |
123 # source code. This list is not exhaustive, but it's still useful to identify | 135 # source code. This list is not exhaustive, but it's still useful to identify |
124 # when this script gets out of sync with the source. See load_objects(). | 136 # when this script gets out of sync with the source. See load_objects(). |
125 # | 137 # |
126 expected_classes = [ | 138 expected_classes = [ |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 | 482 |
471 out.write(footer); | 483 out.write(footer); |
472 | 484 |
473 if (len(sys.argv) < 4): | 485 if (len(sys.argv) < 4): |
474 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); | 486 print('usage: %s output.cc objects.h objects-inl.h' % sys.argv[0]); |
475 sys.exit(2); | 487 sys.exit(2); |
476 | 488 |
477 load_objects(); | 489 load_objects(); |
478 load_fields(); | 490 load_fields(); |
479 emit_config(); | 491 emit_config(); |
OLD | NEW |