Commit ca525298 authored by Igor Sheludko's avatar Igor Sheludko Committed by V8 LUCI CQ

[cleanup] Cleanup BodyDescriptorApply() and friends

In particular
* use variadic templates in BodyDescriptorApply(),
* ensure all the relevant classes have BodyDescriptor definition,
* ensure "objects-body-descriptors[-inl].h" headers are included only
  where necessary.

Bug: v8:12425
Change-Id: I7a95ed94bf62952e3d22d419d4a65ad2fe959d57
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3312273Reviewed-by: 's avatarLeszek Swirski <leszeks@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78242}
parent 18cb0cb4
...@@ -9,9 +9,7 @@ ...@@ -9,9 +9,7 @@
#include "src/heap/invalidated-slots.h" #include "src/heap/invalidated-slots.h"
#include "src/heap/spaces.h" #include "src/heap/spaces.h"
#include "src/objects/objects-body-descriptors-inl.h" #include "src/objects/objects-inl.h"
#include "src/objects/objects-body-descriptors.h"
#include "src/objects/objects.h"
#include "src/utils/allocation.h" #include "src/utils/allocation.h"
namespace v8 { namespace v8 {
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#include "src/objects/microtask-inl.h" #include "src/objects/microtask-inl.h"
#include "src/objects/module-inl.h" #include "src/objects/module-inl.h"
#include "src/objects/name-inl.h" #include "src/objects/name-inl.h"
#include "src/objects/objects-body-descriptors-inl.h"
#include "src/objects/objects-inl.h" #include "src/objects/objects-inl.h"
#include "src/objects/oddball-inl.h" #include "src/objects/oddball-inl.h"
#include "src/objects/ordered-hash-table-inl.h" #include "src/objects/ordered-hash-table-inl.h"
...@@ -87,6 +86,7 @@ ...@@ -87,6 +86,7 @@
#include "src/objects/templates-inl.h" #include "src/objects/templates-inl.h"
#include "src/objects/torque-defined-classes-inl.h" #include "src/objects/torque-defined-classes-inl.h"
#include "src/objects/transitions-inl.h" #include "src/objects/transitions-inl.h"
#include "src/objects/turbofan-types-inl.h"
#ifdef V8_INTL_SUPPORT #ifdef V8_INTL_SUPPORT
#include "src/objects/js-break-iterator-inl.h" #include "src/objects/js-break-iterator-inl.h"
......
...@@ -181,6 +181,8 @@ class AllocationMemento ...@@ -181,6 +181,8 @@ class AllocationMemento
DECL_PRINTER(AllocationMemento) DECL_PRINTER(AllocationMemento)
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(AllocationMemento) TQ_OBJECT_CONSTRUCTORS(AllocationMemento)
}; };
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
class StructBodyDescriptor;
#include "torque-generated/src/objects/api-callbacks-tq.inc" #include "torque-generated/src/objects/api-callbacks-tq.inc"
// An accessor must have a getter, but can have no setter. // An accessor must have a getter, but can have no setter.
...@@ -66,6 +68,8 @@ class AccessorInfo : public TorqueGeneratedAccessorInfo<AccessorInfo, Struct> { ...@@ -66,6 +68,8 @@ class AccessorInfo : public TorqueGeneratedAccessorInfo<AccessorInfo, Struct> {
DECL_PRINTER(AccessorInfo) DECL_PRINTER(AccessorInfo)
using BodyDescriptor = StructBodyDescriptor;
private: private:
inline bool HasExpectedReceiverType(); inline bool HasExpectedReceiverType();
...@@ -80,6 +84,8 @@ class AccessCheckInfo ...@@ -80,6 +84,8 @@ class AccessCheckInfo
public: public:
static AccessCheckInfo Get(Isolate* isolate, Handle<JSObject> receiver); static AccessCheckInfo Get(Isolate* isolate, Handle<JSObject> receiver);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(AccessCheckInfo) TQ_OBJECT_CONSTRUCTORS(AccessCheckInfo)
}; };
...@@ -94,6 +100,8 @@ class InterceptorInfo ...@@ -94,6 +100,8 @@ class InterceptorInfo
DEFINE_TORQUE_GENERATED_INTERCEPTOR_INFO_FLAGS() DEFINE_TORQUE_GENERATED_INTERCEPTOR_INFO_FLAGS()
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(InterceptorInfo) TQ_OBJECT_CONSTRUCTORS(InterceptorInfo)
}; };
...@@ -113,6 +121,8 @@ class CallHandlerInfo ...@@ -113,6 +121,8 @@ class CallHandlerInfo
Address redirected_callback() const; Address redirected_callback() const;
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(CallHandlerInfo) TQ_OBJECT_CONSTRUCTORS(CallHandlerInfo)
}; };
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
class StructBodyDescriptor;
#include "torque-generated/src/objects/arguments-tq.inc" #include "torque-generated/src/objects/arguments-tq.inc"
// Superclass for all objects with instance type {JS_ARGUMENTS_OBJECT_TYPE} // Superclass for all objects with instance type {JS_ARGUMENTS_OBJECT_TYPE}
...@@ -66,6 +68,8 @@ class AliasedArgumentsEntry ...@@ -66,6 +68,8 @@ class AliasedArgumentsEntry
: public TorqueGeneratedAliasedArgumentsEntry<AliasedArgumentsEntry, : public TorqueGeneratedAliasedArgumentsEntry<AliasedArgumentsEntry,
Struct> { Struct> {
public: public:
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(AliasedArgumentsEntry) TQ_OBJECT_CONSTRUCTORS(AliasedArgumentsEntry)
}; };
......
...@@ -21,6 +21,7 @@ namespace internal { ...@@ -21,6 +21,7 @@ namespace internal {
class BreakPoint; class BreakPoint;
class BytecodeArray; class BytecodeArray;
class StructBodyDescriptor;
#include "torque-generated/src/objects/debug-objects-tq.inc" #include "torque-generated/src/objects/debug-objects-tq.inc"
...@@ -132,6 +133,8 @@ class DebugInfo : public TorqueGeneratedDebugInfo<DebugInfo, Struct> { ...@@ -132,6 +133,8 @@ class DebugInfo : public TorqueGeneratedDebugInfo<DebugInfo, Struct> {
static const int kEstimatedNofBreakPointsInFunction = 4; static const int kEstimatedNofBreakPointsInFunction = 4;
using BodyDescriptor = StructBodyDescriptor;
private: private:
// Get the break point info object for a source position. // Get the break point info object for a source position.
Object GetBreakPointInfo(Isolate* isolate, int source_position); Object GetBreakPointInfo(Isolate* isolate, int source_position);
...@@ -163,6 +166,8 @@ class BreakPointInfo ...@@ -163,6 +166,8 @@ class BreakPointInfo
int GetStatementPosition(Handle<DebugInfo> debug_info); int GetStatementPosition(Handle<DebugInfo> debug_info);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(BreakPointInfo) TQ_OBJECT_CONSTRUCTORS(BreakPointInfo)
}; };
...@@ -193,6 +198,8 @@ class CoverageInfo ...@@ -193,6 +198,8 @@ class CoverageInfo
// Holds breakpoint related information. This object is used by inspector. // Holds breakpoint related information. This object is used by inspector.
class BreakPoint : public TorqueGeneratedBreakPoint<BreakPoint, Struct> { class BreakPoint : public TorqueGeneratedBreakPoint<BreakPoint, Struct> {
public: public:
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(BreakPoint) TQ_OBJECT_CONSTRUCTORS(BreakPoint)
}; };
......
...@@ -24,6 +24,7 @@ template <typename T> ...@@ -24,6 +24,7 @@ template <typename T>
class Handle; class Handle;
class Isolate; class Isolate;
class StructBodyDescriptor;
#include "torque-generated/src/objects/descriptor-array-tq.inc" #include "torque-generated/src/objects/descriptor-array-tq.inc"
...@@ -32,6 +33,8 @@ class EnumCache : public TorqueGeneratedEnumCache<EnumCache, Struct> { ...@@ -32,6 +33,8 @@ class EnumCache : public TorqueGeneratedEnumCache<EnumCache, Struct> {
public: public:
DECL_VERIFIER(EnumCache) DECL_VERIFIER(EnumCache)
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(EnumCache) TQ_OBJECT_CONSTRUCTORS(EnumCache)
}; };
......
...@@ -37,6 +37,8 @@ class FreeSpace : public TorqueGeneratedFreeSpace<FreeSpace, HeapObject> { ...@@ -37,6 +37,8 @@ class FreeSpace : public TorqueGeneratedFreeSpace<FreeSpace, HeapObject> {
// Dispatched behavior. // Dispatched behavior.
DECL_PRINTER(FreeSpace) DECL_PRINTER(FreeSpace)
class BodyDescriptor;
private: private:
inline bool IsValid(); inline bool IsValid();
......
...@@ -59,6 +59,8 @@ class HeapNumber ...@@ -59,6 +59,8 @@ class HeapNumber
DECL_PRINTER(HeapNumber) DECL_PRINTER(HeapNumber)
V8_EXPORT_PRIVATE void HeapNumberShortPrint(std::ostream& os); V8_EXPORT_PRIVATE void HeapNumberShortPrint(std::ostream& os);
class BodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(HeapNumber) TQ_OBJECT_CONSTRUCTORS(HeapNumber)
}; };
......
...@@ -16,6 +16,7 @@ namespace internal { ...@@ -16,6 +16,7 @@ namespace internal {
// Forward declarations. // Forward declarations.
class JSPromise; class JSPromise;
class StructBodyDescriptor;
#include "torque-generated/src/objects/js-generator-tq.inc" #include "torque-generated/src/objects/js-generator-tq.inc"
...@@ -71,6 +72,8 @@ class AsyncGeneratorRequest ...@@ -71,6 +72,8 @@ class AsyncGeneratorRequest
DECL_PRINTER(AsyncGeneratorRequest) DECL_PRINTER(AsyncGeneratorRequest)
DECL_VERIFIER(AsyncGeneratorRequest) DECL_VERIFIER(AsyncGeneratorRequest)
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(AsyncGeneratorRequest) TQ_OBJECT_CONSTRUCTORS(AsyncGeneratorRequest)
}; };
......
...@@ -16,6 +16,7 @@ namespace v8 { ...@@ -16,6 +16,7 @@ namespace v8 {
namespace internal { namespace internal {
class ClassLiteral; class ClassLiteral;
class StructBodyDescriptor;
#include "torque-generated/src/objects/literal-objects-tq.inc" #include "torque-generated/src/objects/literal-objects-tq.inc"
...@@ -71,6 +72,8 @@ class ArrayBoilerplateDescription ...@@ -71,6 +72,8 @@ class ArrayBoilerplateDescription
DECL_PRINTER(ArrayBoilerplateDescription) DECL_PRINTER(ArrayBoilerplateDescription)
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
using BodyDescriptor = StructBodyDescriptor;
private: private:
TQ_OBJECT_CONSTRUCTORS(ArrayBoilerplateDescription) TQ_OBJECT_CONSTRUCTORS(ArrayBoilerplateDescription)
}; };
...@@ -82,6 +85,8 @@ class RegExpBoilerplateDescription ...@@ -82,6 +85,8 @@ class RegExpBoilerplateDescription
// Dispatched behavior. // Dispatched behavior.
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
using BodyDescriptor = StructBodyDescriptor;
private: private:
TQ_OBJECT_CONSTRUCTORS(RegExpBoilerplateDescription) TQ_OBJECT_CONSTRUCTORS(RegExpBoilerplateDescription)
}; };
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
class StructBodyDescriptor;
#include "torque-generated/src/objects/microtask-tq.inc" #include "torque-generated/src/objects/microtask-tq.inc"
// Abstract base class for all microtasks that can be scheduled on the // Abstract base class for all microtasks that can be scheduled on the
...@@ -30,6 +32,8 @@ class Microtask : public TorqueGeneratedMicrotask<Microtask, Struct> { ...@@ -30,6 +32,8 @@ class Microtask : public TorqueGeneratedMicrotask<Microtask, Struct> {
class CallbackTask class CallbackTask
: public TorqueGeneratedCallbackTask<CallbackTask, Microtask> { : public TorqueGeneratedCallbackTask<CallbackTask, Microtask> {
public: public:
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(CallbackTask) TQ_OBJECT_CONSTRUCTORS(CallbackTask)
}; };
...@@ -43,6 +47,8 @@ class CallableTask ...@@ -43,6 +47,8 @@ class CallableTask
DECL_VERIFIER(CallableTask) DECL_VERIFIER(CallableTask)
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(CallableTask) TQ_OBJECT_CONSTRUCTORS(CallableTask)
}; };
......
...@@ -181,6 +181,9 @@ class ScriptOrModule ...@@ -181,6 +181,9 @@ class ScriptOrModule
: public TorqueGeneratedScriptOrModule<ScriptOrModule, Struct> { : public TorqueGeneratedScriptOrModule<ScriptOrModule, Struct> {
public: public:
DECL_PRINTER(ScriptOrModule) DECL_PRINTER(ScriptOrModule)
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(ScriptOrModule) TQ_OBJECT_CONSTRUCTORS(ScriptOrModule)
}; };
......
This diff is collapsed.
...@@ -152,7 +152,11 @@ class FlexibleBodyDescriptor : public SuffixRangeBodyDescriptor<start_offset> { ...@@ -152,7 +152,11 @@ class FlexibleBodyDescriptor : public SuffixRangeBodyDescriptor<start_offset> {
static inline int SizeOf(Map map, HeapObject object); static inline int SizeOf(Map map, HeapObject object);
}; };
using StructBodyDescriptor = FlexibleBodyDescriptor<HeapObject::kHeaderSize>; // A forward-declacable descriptor body alias for most of the Struct successors.
class StructBodyDescriptor
: public FlexibleBodyDescriptor<HeapObject::kHeaderSize> {
public:
};
// This class describes a body of an object in which all pointer fields are // This class describes a body of an object in which all pointer fields are
// located in the [start_offset, object_size) interval. // located in the [start_offset, object_size) interval.
......
...@@ -2172,15 +2172,15 @@ void HeapObject::IterateBody(Map map, int object_size, ObjectVisitor* v) { ...@@ -2172,15 +2172,15 @@ void HeapObject::IterateBody(Map map, int object_size, ObjectVisitor* v) {
struct CallIsValidSlot { struct CallIsValidSlot {
template <typename BodyDescriptor> template <typename BodyDescriptor>
static bool apply(Map map, HeapObject obj, int offset, int) { static bool apply(Map map, HeapObject obj, int offset) {
return BodyDescriptor::IsValidSlot(map, obj, offset); return BodyDescriptor::IsValidSlot(map, obj, offset);
} }
}; };
bool HeapObject::IsValidSlot(Map map, int offset) { bool HeapObject::IsValidSlot(Map map, int offset) {
DCHECK_NE(0, offset); DCHECK_NE(0, offset);
return BodyDescriptorApply<CallIsValidSlot, bool>(map.instance_type(), map, return BodyDescriptorApply<CallIsValidSlot>(map.instance_type(), map, *this,
*this, offset, 0); offset);
} }
int HeapObject::SizeFromMap(Map map) const { int HeapObject::SizeFromMap(Map map) const {
......
...@@ -14,6 +14,7 @@ namespace v8 { ...@@ -14,6 +14,7 @@ namespace v8 {
namespace internal { namespace internal {
class JSPromise; class JSPromise;
class StructBodyDescriptor;
#include "torque-generated/src/objects/promise-tq.inc" #include "torque-generated/src/objects/promise-tq.inc"
...@@ -31,6 +32,9 @@ class PromiseReactionJobTask ...@@ -31,6 +32,9 @@ class PromiseReactionJobTask
Microtask> { Microtask> {
public: public:
static const int kSizeOfAllPromiseReactionJobTasks = kHeaderSize; static const int kSizeOfAllPromiseReactionJobTasks = kHeaderSize;
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseReactionJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseReactionJobTask)
}; };
...@@ -41,6 +45,8 @@ class PromiseFulfillReactionJobTask ...@@ -41,6 +45,8 @@ class PromiseFulfillReactionJobTask
public: public:
STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks); STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseFulfillReactionJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseFulfillReactionJobTask)
}; };
...@@ -51,6 +57,8 @@ class PromiseRejectReactionJobTask ...@@ -51,6 +57,8 @@ class PromiseRejectReactionJobTask
public: public:
STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks); STATIC_ASSERT(kSize == kSizeOfAllPromiseReactionJobTasks);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseRejectReactionJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseRejectReactionJobTask)
}; };
...@@ -59,6 +67,8 @@ class PromiseResolveThenableJobTask ...@@ -59,6 +67,8 @@ class PromiseResolveThenableJobTask
: public TorqueGeneratedPromiseResolveThenableJobTask< : public TorqueGeneratedPromiseResolveThenableJobTask<
PromiseResolveThenableJobTask, Microtask> { PromiseResolveThenableJobTask, Microtask> {
public: public:
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseResolveThenableJobTask) TQ_OBJECT_CONSTRUCTORS(PromiseResolveThenableJobTask)
}; };
...@@ -66,6 +76,8 @@ class PromiseResolveThenableJobTask ...@@ -66,6 +76,8 @@ class PromiseResolveThenableJobTask
class PromiseCapability class PromiseCapability
: public TorqueGeneratedPromiseCapability<PromiseCapability, Struct> { : public TorqueGeneratedPromiseCapability<PromiseCapability, Struct> {
public: public:
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseCapability) TQ_OBJECT_CONSTRUCTORS(PromiseCapability)
}; };
...@@ -91,6 +103,8 @@ class PromiseReaction ...@@ -91,6 +103,8 @@ class PromiseReaction
public: public:
enum Type { kFulfill, kReject }; enum Type { kFulfill, kReject };
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PromiseReaction) TQ_OBJECT_CONSTRUCTORS(PromiseReaction)
}; };
......
...@@ -35,6 +35,8 @@ class PropertyDescriptorObject ...@@ -35,6 +35,8 @@ class PropertyDescriptorObject
HasWritableBit::kMask | HasValueBit::kMask | HasWritableBit::kMask | HasValueBit::kMask |
HasGetBit::kMask | HasSetBit::kMask; HasGetBit::kMask | HasSetBit::kMask;
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(PropertyDescriptorObject) TQ_OBJECT_CONSTRUCTORS(PropertyDescriptorObject)
}; };
......
...@@ -22,6 +22,7 @@ namespace v8 { ...@@ -22,6 +22,7 @@ namespace v8 {
namespace internal { namespace internal {
class FunctionLiteral; class FunctionLiteral;
class StructBodyDescriptor;
namespace wasm { namespace wasm {
class NativeModule; class NativeModule;
...@@ -230,6 +231,8 @@ class Script : public TorqueGeneratedScript<Script, Struct> { ...@@ -230,6 +231,8 @@ class Script : public TorqueGeneratedScript<Script, Struct> {
DECL_PRINTER(Script) DECL_PRINTER(Script)
DECL_VERIFIER(Script) DECL_VERIFIER(Script)
using BodyDescriptor = StructBodyDescriptor;
private: private:
// Bit positions in the flags field. // Bit positions in the flags field.
DEFINE_TORQUE_GENERATED_SCRIPT_FLAGS() DEFINE_TORQUE_GENERATED_SCRIPT_FLAGS()
......
...@@ -148,6 +148,8 @@ class UncompiledDataWithPreparseData ...@@ -148,6 +148,8 @@ class UncompiledDataWithPreparseData
class InterpreterData class InterpreterData
: public TorqueGeneratedInterpreterData<InterpreterData, Struct> { : public TorqueGeneratedInterpreterData<InterpreterData, Struct> {
public: public:
using BodyDescriptor = StructBodyDescriptor;
private: private:
TQ_OBJECT_CONSTRUCTORS(InterpreterData) TQ_OBJECT_CONSTRUCTORS(InterpreterData)
}; };
......
...@@ -17,6 +17,7 @@ namespace v8 { ...@@ -17,6 +17,7 @@ namespace v8 {
namespace internal { namespace internal {
class UnorderedModuleSet; class UnorderedModuleSet;
class StructBodyDescriptor;
#include "torque-generated/src/objects/source-text-module-tq.inc" #include "torque-generated/src/objects/source-text-module-tq.inc"
...@@ -276,6 +277,8 @@ class ModuleRequest ...@@ -276,6 +277,8 @@ class ModuleRequest
// a single assertion. // a single assertion.
static const size_t kAssertionEntrySize = 3; static const size_t kAssertionEntrySize = 3;
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(ModuleRequest) TQ_OBJECT_CONSTRUCTORS(ModuleRequest)
}; };
...@@ -292,6 +295,8 @@ class SourceTextModuleInfoEntry ...@@ -292,6 +295,8 @@ class SourceTextModuleInfoEntry
Handle<PrimitiveHeapObject> import_name, int module_request, Handle<PrimitiveHeapObject> import_name, int module_request,
int cell_index, int beg_pos, int end_pos); int cell_index, int beg_pos, int end_pos);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(SourceTextModuleInfoEntry) TQ_OBJECT_CONSTRUCTORS(SourceTextModuleInfoEntry)
}; };
......
...@@ -16,6 +16,7 @@ namespace internal { ...@@ -16,6 +16,7 @@ namespace internal {
class MessageLocation; class MessageLocation;
class WasmInstanceObject; class WasmInstanceObject;
class StructBodyDescriptor;
#include "torque-generated/src/objects/stack-frame-info-tq.inc" #include "torque-generated/src/objects/stack-frame-info-tq.inc"
...@@ -86,6 +87,8 @@ class StackFrameInfo ...@@ -86,6 +87,8 @@ class StackFrameInfo
static bool ComputeLocation(Handle<StackFrameInfo> info, static bool ComputeLocation(Handle<StackFrameInfo> info,
MessageLocation* location); MessageLocation* location);
using BodyDescriptor = StructBodyDescriptor;
private: private:
// Bit position in the flag, from least significant bit position. // Bit position in the flag, from least significant bit position.
DEFINE_TORQUE_GENERATED_STACK_FRAME_INFO_FLAGS() DEFINE_TORQUE_GENERATED_STACK_FRAME_INFO_FLAGS()
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
class StructBodyDescriptor;
#include "torque-generated/src/objects/struct-tq.inc" #include "torque-generated/src/objects/struct-tq.inc"
// An abstract superclass, a marker class really, for simple structure classes. // An abstract superclass, a marker class really, for simple structure classes.
...@@ -31,6 +33,8 @@ class Tuple2 : public TorqueGeneratedTuple2<Tuple2, Struct> { ...@@ -31,6 +33,8 @@ class Tuple2 : public TorqueGeneratedTuple2<Tuple2, Struct> {
public: public:
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(Tuple2) TQ_OBJECT_CONSTRUCTORS(Tuple2)
}; };
...@@ -69,6 +73,8 @@ class AccessorPair : public TorqueGeneratedAccessorPair<AccessorPair, Struct> { ...@@ -69,6 +73,8 @@ class AccessorPair : public TorqueGeneratedAccessorPair<AccessorPair, Struct> {
inline bool Equals(Object getter_value, Object setter_value); inline bool Equals(Object getter_value, Object setter_value);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(AccessorPair) TQ_OBJECT_CONSTRUCTORS(AccessorPair)
}; };
...@@ -78,6 +84,8 @@ class ClassPositions ...@@ -78,6 +84,8 @@ class ClassPositions
// Dispatched behavior. // Dispatched behavior.
void BriefPrintDetails(std::ostream& os); void BriefPrintDetails(std::ostream& os);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(ClassPositions) TQ_OBJECT_CONSTRUCTORS(ClassPositions)
}; };
......
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
namespace v8 { namespace v8 {
namespace internal { namespace internal {
class StructBodyDescriptor;
#include "torque-generated/src/objects/template-objects-tq.inc" #include "torque-generated/src/objects/template-objects-tq.inc"
// CachedTemplateObject is a tuple used to cache a TemplateObject that has been // CachedTemplateObject is a tuple used to cache a TemplateObject that has been
...@@ -27,6 +29,8 @@ class CachedTemplateObject final ...@@ -27,6 +29,8 @@ class CachedTemplateObject final
Handle<JSArray> template_object, Handle<JSArray> template_object,
Handle<HeapObject> next); Handle<HeapObject> next);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(CachedTemplateObject) TQ_OBJECT_CONSTRUCTORS(CachedTemplateObject)
}; };
...@@ -42,6 +46,8 @@ class TemplateObjectDescription final ...@@ -42,6 +46,8 @@ class TemplateObjectDescription final
Handle<TemplateObjectDescription> description, Handle<TemplateObjectDescription> description,
Handle<SharedFunctionInfo> shared_info, int slot_id); Handle<SharedFunctionInfo> shared_info, int slot_id);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(TemplateObjectDescription) TQ_OBJECT_CONSTRUCTORS(TemplateObjectDescription)
}; };
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
namespace v8 { namespace v8 {
class CFunctionInfo; class CFunctionInfo;
class StructBodyDescriptor;
namespace internal { namespace internal {
...@@ -40,6 +41,8 @@ class TemplateInfo : public TorqueGeneratedTemplateInfo<TemplateInfo, Struct> { ...@@ -40,6 +41,8 @@ class TemplateInfo : public TorqueGeneratedTemplateInfo<TemplateInfo, Struct> {
inline bool should_cache() const; inline bool should_cache() const;
inline bool is_cached() const; inline bool is_cached() const;
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(TemplateInfo) TQ_OBJECT_CONSTRUCTORS(TemplateInfo)
}; };
...@@ -49,6 +52,9 @@ class FunctionTemplateRareData ...@@ -49,6 +52,9 @@ class FunctionTemplateRareData
Struct> { Struct> {
public: public:
DECL_VERIFIER(FunctionTemplateRareData) DECL_VERIFIER(FunctionTemplateRareData)
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(FunctionTemplateRareData) TQ_OBJECT_CONSTRUCTORS(FunctionTemplateRareData)
}; };
...@@ -176,6 +182,8 @@ class FunctionTemplateInfo ...@@ -176,6 +182,8 @@ class FunctionTemplateInfo
// Bit position in the flag, from least significant bit position. // Bit position in the flag, from least significant bit position.
DEFINE_TORQUE_GENERATED_FUNCTION_TEMPLATE_INFO_FLAGS() DEFINE_TORQUE_GENERATED_FUNCTION_TEMPLATE_INFO_FLAGS()
using BodyDescriptor = StructBodyDescriptor;
private: private:
static constexpr int kNoJSApiObjectType = 0; static constexpr int kNoJSApiObjectType = 0;
static inline FunctionTemplateRareData EnsureFunctionTemplateRareData( static inline FunctionTemplateRareData EnsureFunctionTemplateRareData(
...@@ -202,6 +210,8 @@ class ObjectTemplateInfo ...@@ -202,6 +210,8 @@ class ObjectTemplateInfo
// chain till a function template that has an instance template is found. // chain till a function template that has an instance template is found.
inline ObjectTemplateInfo GetParent(Isolate* isolate); inline ObjectTemplateInfo GetParent(Isolate* isolate);
using BodyDescriptor = StructBodyDescriptor;
private: private:
DEFINE_TORQUE_GENERATED_OBJECT_TEMPLATE_INFO_FLAGS() DEFINE_TORQUE_GENERATED_OBJECT_TEMPLATE_INFO_FLAGS()
......
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include "src/objects/js-regexp-inl.h" #include "src/objects/js-regexp-inl.h"
#include "src/objects/js-weak-refs-inl.h" #include "src/objects/js-weak-refs-inl.h"
#include "src/objects/literal-objects-inl.h" #include "src/objects/literal-objects-inl.h"
#include "src/objects/objects-body-descriptors.h"
#include "src/objects/objects-inl.h" #include "src/objects/objects-inl.h"
#include "src/objects/prototype.h" #include "src/objects/prototype.h"
#include "src/objects/slots-inl.h" #include "src/objects/slots-inl.h"
......
...@@ -42,6 +42,7 @@ class WireBytesRef; ...@@ -42,6 +42,7 @@ class WireBytesRef;
class BreakPoint; class BreakPoint;
class JSArrayBuffer; class JSArrayBuffer;
class SeqOneByteString; class SeqOneByteString;
class StructBodyDescriptor;
class WasmCapiFunction; class WasmCapiFunction;
class WasmExceptionTag; class WasmExceptionTag;
class WasmExportedFunction; class WasmExportedFunction;
...@@ -858,6 +859,8 @@ class WasmExceptionTag ...@@ -858,6 +859,8 @@ class WasmExceptionTag
V8_EXPORT_PRIVATE static Handle<WasmExceptionTag> New(Isolate* isolate, V8_EXPORT_PRIVATE static Handle<WasmExceptionTag> New(Isolate* isolate,
int index); int index);
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(WasmExceptionTag) TQ_OBJECT_CONSTRUCTORS(WasmExceptionTag)
}; };
...@@ -871,6 +874,8 @@ class AsmWasmData : public TorqueGeneratedAsmWasmData<AsmWasmData, Struct> { ...@@ -871,6 +874,8 @@ class AsmWasmData : public TorqueGeneratedAsmWasmData<AsmWasmData, Struct> {
DECL_PRINTER(AsmWasmData) DECL_PRINTER(AsmWasmData)
using BodyDescriptor = StructBodyDescriptor;
TQ_OBJECT_CONSTRUCTORS(AsmWasmData) TQ_OBJECT_CONSTRUCTORS(AsmWasmData)
}; };
...@@ -994,12 +999,15 @@ class WasmContinuationObject ...@@ -994,12 +999,15 @@ class WasmContinuationObject
WasmContinuationObject parent); WasmContinuationObject parent);
DECL_PRINTER(WasmContinuationObject) DECL_PRINTER(WasmContinuationObject)
TQ_OBJECT_CONSTRUCTORS(WasmContinuationObject)
using BodyDescriptor = StructBodyDescriptor;
private: private:
static Handle<WasmContinuationObject> New( static Handle<WasmContinuationObject> New(
Isolate* isolate, std::unique_ptr<wasm::StackMemory> stack, Isolate* isolate, std::unique_ptr<wasm::StackMemory> stack,
HeapObject parent); HeapObject parent);
TQ_OBJECT_CONSTRUCTORS(WasmContinuationObject)
}; };
// The suspender object provides an API to suspend and resume wasm code using // The suspender object provides an API to suspend and resume wasm code using
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment