@@ -100,71 +100,45 @@ class PreparseData : public HeapObject {
100100
101101// Abstract class representing extra data for an uncompiled function, which is
102102// not stored in the SharedFunctionInfo.
103- class UncompiledData : public HeapObject {
103+ class UncompiledData
104+ : public TorqueGeneratedUncompiledData<UncompiledData, HeapObject> {
104105 public:
105- DECL_ACCESSORS (inferred_name, String)
106- DECL_INT32_ACCESSORS (start_position)
107- DECL_INT32_ACCESSORS (end_position)
108-
109- DECL_CAST (UncompiledData)
110-
111106 inline static void Initialize (
112107 UncompiledData data, String inferred_name, int start_position,
113108 int end_position,
114109 std::function<void (HeapObject object, ObjectSlot slot, HeapObject target)>
115110 gc_notify_updated_slot =
116111 [](HeapObject object, ObjectSlot slot, HeapObject target) {});
117112
118- // Layout description.
119- #define UNCOMPILED_DATA_FIELDS (V ) \
120- V (kStartOfStrongFieldsOffset , 0 ) \
121- V (kInferredNameOffset , kTaggedSize ) \
122- V (kEndOfStrongFieldsOffset , 0 ) \
123- /* Raw data fields. */ \
124- V (kStartPositionOffset , kInt32Size ) \
125- V (kEndPositionOffset , kInt32Size ) \
126- V (kOptionalPaddingOffset , POINTER_SIZE_PADDING(kOptionalPaddingOffset )) \
127- /* Header size. */ \
128- V (kSize , 0 )
129-
130- DEFINE_FIELD_OFFSET_CONSTANTS (HeapObject::kHeaderSize , UNCOMPILED_DATA_FIELDS)
131- #undef UNCOMPILED_DATA_FIELDS
132-
133- using BodyDescriptor = FixedBodyDescriptor<kStartOfStrongFieldsOffset ,
134- kEndOfStrongFieldsOffset , kSize >;
135-
136- // Clear uninitialized padding space.
137- inline void clear_padding ();
113+ using BodyDescriptor =
114+ FixedBodyDescriptor<kStartOfStrongFieldsOffset , kEndOfStrongFieldsOffset ,
115+ kHeaderSize >;
138116
139- OBJECT_CONSTRUCTORS (UncompiledData, HeapObject);
117+ TQ_OBJECT_CONSTRUCTORS (UncompiledData)
140118};
141119
142120// Class representing data for an uncompiled function that does not have any
143121// data from the pre-parser, either because it's a leaf function or because the
144122// pre-parser bailed out.
145- class UncompiledDataWithoutPreparseData : public UncompiledData {
123+ class UncompiledDataWithoutPreparseData
124+ : public TorqueGeneratedUncompiledDataWithoutPreparseData<
125+ UncompiledDataWithoutPreparseData, UncompiledData> {
146126 public:
147- DECL_CAST (UncompiledDataWithoutPreparseData)
148127 DECL_PRINTER (UncompiledDataWithoutPreparseData)
149- DECL_VERIFIER (UncompiledDataWithoutPreparseData)
150-
151- static const int kSize = UncompiledData::kSize ;
152128
153129 // No extra fields compared to UncompiledData.
154130 using BodyDescriptor = UncompiledData::BodyDescriptor;
155131
156- OBJECT_CONSTRUCTORS (UncompiledDataWithoutPreparseData, UncompiledData);
132+ TQ_OBJECT_CONSTRUCTORS (UncompiledDataWithoutPreparseData)
157133};
158134
159135// Class representing data for an uncompiled function that has pre-parsed scope
160136// data.
161- class UncompiledDataWithPreparseData : public UncompiledData {
137+ class UncompiledDataWithPreparseData
138+ : public TorqueGeneratedUncompiledDataWithPreparseData<
139+ UncompiledDataWithPreparseData, UncompiledData> {
162140 public:
163- DECL_ACCESSORS (preparse_data, PreparseData)
164-
165- DECL_CAST (UncompiledDataWithPreparseData)
166141 DECL_PRINTER (UncompiledDataWithPreparseData)
167- DECL_VERIFIER (UncompiledDataWithPreparseData)
168142
169143 inline static void Initialize (
170144 UncompiledDataWithPreparseData data, String inferred_name,
@@ -173,28 +147,12 @@ class UncompiledDataWithPreparseData : public UncompiledData {
173147 gc_notify_updated_slot =
174148 [](HeapObject object, ObjectSlot slot, HeapObject target) {});
175149
176- // Layout description.
177-
178- #define UNCOMPILED_DATA_WITH_PREPARSE_DATA_FIELDS (V ) \
179- V (kStartOfStrongFieldsOffset , 0 ) \
180- V (kPreparseDataOffset , kTaggedSize ) \
181- V (kEndOfStrongFieldsOffset , 0 ) \
182- /* Total size. */ \
183- V (kSize , 0 )
184-
185- DEFINE_FIELD_OFFSET_CONSTANTS (UncompiledData::kSize ,
186- UNCOMPILED_DATA_WITH_PREPARSE_DATA_FIELDS)
187- #undef UNCOMPILED_DATA_WITH_PREPARSE_DATA_FIELDS
188-
189- // Make sure the size is aligned
190- STATIC_ASSERT (IsAligned(kSize , kTaggedSize ));
191-
192150 using BodyDescriptor = SubclassBodyDescriptor<
193151 UncompiledData::BodyDescriptor,
194152 FixedBodyDescriptor<kStartOfStrongFieldsOffset , kEndOfStrongFieldsOffset ,
195153 kSize >>;
196154
197- OBJECT_CONSTRUCTORS (UncompiledDataWithPreparseData, UncompiledData);
155+ TQ_OBJECT_CONSTRUCTORS (UncompiledDataWithPreparseData)
198156};
199157
200158class InterpreterData : public Struct {
0 commit comments