Commit 10ca48ff authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[compiler] Merge the Ref lists

Prior to this CL, Refs were defined through four lists:

HEAP_BROKER_SERIALIZED_OBJECT_LIST
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST

Due to the way FooData objects are constructed (a long if-else chain
generated from these lists), the order of entries within the lists and
also between lists was important. In particular, subtypes had to
appear before all their supertypes. Within one list this was doable,
but with the split into 4 different lists this invariant cannot hold
in practice.

This CL refactors the four lists back into a single list to make
observing the invariant possible with upcoming changes. The new
unified list contains the RefSerializationKind as a second argument.

Related changes are not very interesting, except for
TryGetOrCreateData which now uses a set of templated functor objects
for setup (this was necessary to handle different FooData constructor
signatures).

Bug: v8:7790
Change-Id: Ia4c030c767830be4253cf41e3aaf67454f1cbef6
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843351
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Auto-Submit: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74171}
parent d8e1f4d5
......@@ -27,11 +27,8 @@ namespace compiler {
#define TRACE(broker, x) TRACE_BROKER(broker, x)
#define TRACE_MISSING(broker, x) TRACE_BROKER_MISSING(broker, x)
#define FORWARD_DECL(Name) class Name##Data;
HEAP_BROKER_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
#define FORWARD_DECL(Name, ...) class Name##Data;
HEAP_BROKER_OBJECT_LIST(FORWARD_DECL)
#undef FORWARD_DECL
// There are several kinds of ObjectData values.
......@@ -85,13 +82,15 @@ constexpr bool IsSerializedHeapObject() {
return false;
}
#define DEFINE_MARKER(Name) \
template <> \
constexpr bool IsSerializedHeapObject<Name>() { \
return true; \
} \
STATIC_ASSERT(IsSerializedHeapObject<Name>());
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DEFINE_MARKER)
#define DEFINE_MARKER(Name, Kind) \
template <> \
constexpr bool IsSerializedHeapObject<Name>() { \
return Kind == RefSerializationKind::kSerialized; \
} \
/* The static assert is needed to avoid 'unused function' warnings. */ \
STATIC_ASSERT(IsSerializedHeapObject<Name>() == \
(Kind == RefSerializationKind::kSerialized));
HEAP_BROKER_OBJECT_LIST(DEFINE_MARKER)
#undef DEFINE_MARKER
} // namespace
......@@ -133,18 +132,12 @@ class ObjectData : public ZoneObject {
IsReadOnlyHeapObject(*object));
}
#define DECLARE_IS(Name) bool Is##Name() const;
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DECLARE_IS)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(DECLARE_IS)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(DECLARE_IS)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(DECLARE_IS)
#define DECLARE_IS(Name, ...) bool Is##Name() const;
HEAP_BROKER_OBJECT_LIST(DECLARE_IS)
#undef DECLARE_IS
#define DECLARE_AS(Name) Name##Data* As##Name();
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DECLARE_AS)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(DECLARE_AS)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(DECLARE_AS)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(DECLARE_AS)
#define DECLARE_AS(Name, ...) Name##Data* As##Name();
HEAP_BROKER_OBJECT_LIST(DECLARE_AS)
#undef DECLARE_AS
Handle<Object> object() const { return object_; }
......@@ -2221,7 +2214,7 @@ class CodeData : public HeapObjectData {
unsigned const inlined_bytecode_size_;
};
#define DEFINE_IS(Name) \
#define DEFINE_IS(Name, ...) \
bool ObjectData::Is##Name() const { \
if (should_access_heap()) { \
return object()->Is##Name(); \
......@@ -2231,36 +2224,25 @@ class CodeData : public HeapObjectData {
static_cast<const HeapObjectData*>(this)->GetMapInstanceType(); \
return InstanceTypeChecker::Is##Name(instance_type); \
}
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DEFINE_IS)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(DEFINE_IS)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(DEFINE_IS)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(DEFINE_IS)
HEAP_BROKER_OBJECT_LIST(DEFINE_IS)
#undef DEFINE_IS
#define DEFINE_AS(Name) \
Name##Data* ObjectData::As##Name() { \
CHECK(Is##Name()); \
CHECK(kind_ == kSerializedHeapObject || \
kind_ == kBackgroundSerializedHeapObject); \
return static_cast<Name##Data*>(this); \
}
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DEFINE_AS)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(DEFINE_AS)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(DEFINE_AS)
#undef DEFINE_AS
// TODO(solanes, v8:10866): Remove once broker()->is_concurrent_inlining() is
// removed.
// This macro defines the Asxxx methods for NeverSerialized objects, which
// should only be used with direct heap access off.
#define DEFINE_AS(Name) \
Name##Data* ObjectData::As##Name() { \
DCHECK(!broker()->is_concurrent_inlining()); \
CHECK(Is##Name()); \
CHECK_EQ(kind_, kSerializedHeapObject); \
return static_cast<Name##Data*>(this); \
}
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(DEFINE_AS)
// TODO(solanes, v8:10866): Remove support for kNeverSerialized objects here
// once broker()->is_concurrent_inlining() is removed.
// AsFoo() methods for NeverSerialized objects should only be used with direct
// heap access off.
#define DEFINE_AS(Name, Kind) \
Name##Data* ObjectData::As##Name() { \
DCHECK_IMPLIES(Kind == RefSerializationKind::kNeverSerialized, \
!broker()->is_concurrent_inlining()); \
DCHECK_IMPLIES(Kind == RefSerializationKind::kNeverSerialized, \
kind_ == kSerializedHeapObject); \
CHECK(Is##Name()); \
CHECK(kind_ == kSerializedHeapObject || \
kind_ == kBackgroundSerializedHeapObject); \
return static_cast<Name##Data*>(this); \
}
HEAP_BROKER_OBJECT_LIST(DEFINE_AS)
#undef DEFINE_AS
ObjectData* JSObjectData::GetInobjectField(int property_index) const {
......@@ -2722,6 +2704,114 @@ void JSHeapBroker::InitializeAndStartSerializing(
TRACE(this, "Finished serializing standard objects");
}
namespace {
template <RefSerializationKind Kind, class DataT, class ObjectT>
struct CreateDataFunctor {
bool operator()(JSHeapBroker* broker, RefsMap* refs,
ObjectRef::BackgroundSerialization background_serialization,
Handle<Object> object, RefsMap::Entry** entry_out,
ObjectData** object_data_out) {
USE(broker, refs, background_serialization, object, entry_out,
object_data_out);
UNREACHABLE();
}
};
template <class DataT, class ObjectT>
struct CreateDataFunctor<RefSerializationKind::kSerialized, DataT, ObjectT> {
bool operator()(JSHeapBroker* broker, RefsMap* refs,
ObjectRef::BackgroundSerialization background_serialization,
Handle<Object> object, RefsMap::Entry** entry_out,
ObjectData** object_data_out) {
if (broker->mode() == JSHeapBroker::kSerializing) {
RefsMap::Entry* entry = refs->LookupOrInsert(object.address());
*object_data_out = broker->zone()->New<DataT>(
broker, &entry->value, Handle<ObjectT>::cast(object));
*entry_out = entry;
return true;
}
return false;
}
};
template <class DataT, class ObjectT>
struct CreateDataFunctor<RefSerializationKind::kBackgroundSerialized, DataT,
ObjectT> {
bool operator()(JSHeapBroker* broker, RefsMap* refs,
ObjectRef::BackgroundSerialization background_serialization,
Handle<Object> object, RefsMap::Entry** entry_out,
ObjectData** object_data_out) {
if (broker->is_concurrent_inlining()) {
RefsMap::Entry* entry = refs->LookupOrInsert(object.address());
*object_data_out = broker->zone()->New<DataT>(
broker, &entry->value, Handle<ObjectT>::cast(object),
kBackgroundSerializedHeapObject);
*entry_out = entry;
return true;
} else if (broker->mode() == JSHeapBroker::kSerializing) {
RefsMap::Entry* entry = refs->LookupOrInsert(object.address());
*object_data_out = broker->zone()->New<DataT>(
broker, &entry->value, Handle<ObjectT>::cast(object));
*entry_out = entry;
return true;
}
return false;
}
};
template <class DataT, class ObjectT>
struct CreateDataFunctor<RefSerializationKind::kPossiblyBackgroundSerialized,
DataT, ObjectT> {
bool operator()(JSHeapBroker* broker, RefsMap* refs,
ObjectRef::BackgroundSerialization background_serialization,
Handle<Object> object, RefsMap::Entry** entry_out,
ObjectData** object_data_out) {
if (broker->mode() == JSHeapBroker::kSerialized &&
background_serialization !=
ObjectRef::BackgroundSerialization::kAllowed) {
return false;
}
RefsMap::Entry* entry = refs->LookupOrInsert(object.address());
ObjectDataKind kind = (background_serialization ==
ObjectRef::BackgroundSerialization::kAllowed)
? kBackgroundSerializedHeapObject
: kSerializedHeapObject;
*object_data_out = broker->zone()->New<DataT>(
broker, &entry->value, Handle<ObjectT>::cast(object), kind);
*entry_out = entry;
return true;
}
};
template <class DataT, class ObjectT>
struct CreateDataFunctor<RefSerializationKind::kNeverSerialized, DataT,
ObjectT> {
bool operator()(JSHeapBroker* broker, RefsMap* refs,
ObjectRef::BackgroundSerialization, Handle<Object> object,
RefsMap::Entry** entry_out, ObjectData** object_data_out) {
// TODO(solanes, v8:10866): Remove the `(mode() == kSerializing)` case
// below when all classes skip serialization. Same for similar spots if we
// end up keeping them.
if (broker->is_concurrent_inlining()) {
RefsMap::Entry* entry = refs->LookupOrInsert(object.address());
*object_data_out = broker->zone()->New<ObjectData>(
broker, &entry->value, object, kNeverSerializedHeapObject);
*entry_out = entry;
return true;
} else if (broker->mode() == JSHeapBroker::kSerializing) {
RefsMap::Entry* entry = refs->LookupOrInsert(object.address());
*object_data_out = broker->zone()->New<DataT>(
broker, &entry->value, Handle<ObjectT>::cast(object));
*entry_out = entry;
return true;
}
return false;
}
};
} // namespace
ObjectData* JSHeapBroker::TryGetOrCreateData(
Handle<Object> object, bool crash_on_error,
ObjectRef::BackgroundSerialization background_serialization) {
......@@ -2750,81 +2840,18 @@ ObjectData* JSHeapBroker::TryGetOrCreateData(
entry = refs_->LookupOrInsert(object.address());
object_data = zone()->New<ObjectData>(this, &(entry->value), object,
kUnserializedReadOnlyHeapObject);
// TODO(solanes, v8:10866): Remove the `(mode() == kSerializing)` case in this
// macro when all classes skip serialization. Same for the other macros if we
// end up keeping them.
#define CREATE_DATA_FOR_DIRECT_READ(name) \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
else if (object->Is##name()) { \
if (is_concurrent_inlining()) { \
entry = refs_->LookupOrInsert(object.address()); \
object_data = zone()->New<ObjectData>(this, &(entry->value), object, \
kNeverSerializedHeapObject); \
} else if (mode() == kSerializing) { \
entry = refs_->LookupOrInsert(object.address()); \
object_data = zone()->New<name##Data>(this, &(entry->value), \
Handle<name>::cast(object)); \
} else { \
CHECK(!crash_on_error); \
return nullptr; \
}
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(CREATE_DATA_FOR_DIRECT_READ)
#undef CREATE_DATA_FOR_DIRECT_READ
#define CREATE_DATA_FOR_POSSIBLE_SERIALIZATION(name) \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
else if (object->Is##name()) { \
if (mode() == kSerialized && \
background_serialization != \
ObjectRef::BackgroundSerialization::kAllowed) { \
CHECK(!crash_on_error); \
return nullptr; \
} \
entry = refs_->LookupOrInsert(object.address()); \
ObjectDataKind kind = (background_serialization == \
ObjectRef::BackgroundSerialization::kAllowed) \
? kBackgroundSerializedHeapObject \
: kSerializedHeapObject; \
object_data = zone()->New<name##Data>(this, &(entry->value), \
Handle<name>::cast(object), kind);
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(
CREATE_DATA_FOR_POSSIBLE_SERIALIZATION)
#undef CREATE_DATA_FOR_POSSIBLE_SERIALIZATION
#define CREATE_DATA_FOR_BACKGROUND_SERIALIZATION(name) \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
else if (object->Is##name()) { \
if (is_concurrent_inlining()) { \
entry = refs_->LookupOrInsert(object.address()); \
object_data = zone()->New<name##Data>(this, &(entry->value), \
Handle<name>::cast(object), \
kBackgroundSerializedHeapObject); \
} else if (mode() == kSerializing) { \
entry = refs_->LookupOrInsert(object.address()); \
object_data = zone()->New<name##Data>(this, &(entry->value), \
Handle<name>::cast(object)); \
} else { \
CHECK(!crash_on_error); \
return nullptr; \
}
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(
CREATE_DATA_FOR_BACKGROUND_SERIALIZATION)
#undef CREATE_DATA_FOR_SERIALIZATION
#define CREATE_DATA_FOR_SERIALIZATION(name) \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
else if (object->Is##name()) { \
if (mode() == kSerializing) { \
entry = refs_->LookupOrInsert(object.address()); \
object_data = zone()->New<name##Data>(this, &(entry->value), \
Handle<name>::cast(object)); \
} else { \
CHECK(!crash_on_error); \
return nullptr; \
#define CREATE_DATA(Name, Kind) \
} \
/* NOLINTNEXTLINE(readability/braces) */ \
else if (object->Is##Name()) { \
CreateDataFunctor<Kind, Name##Data, Name> f; \
if (!f(this, refs_, background_serialization, object, &entry, \
&object_data)) { \
CHECK(!crash_on_error); \
return nullptr; \
}
HEAP_BROKER_SERIALIZED_OBJECT_LIST(CREATE_DATA_FOR_SERIALIZATION)
#undef CREATE_DATA_FOR_SERIALIZATION
HEAP_BROKER_OBJECT_LIST(CREATE_DATA)
#undef CREATE_DATA
} else {
UNREACHABLE();
}
......@@ -2834,16 +2861,13 @@ ObjectData* JSHeapBroker::TryGetOrCreateData(
return object_data;
}
#define DEFINE_IS_AND_AS(Name) \
#define DEFINE_IS_AND_AS(Name, ...) \
bool ObjectRef::Is##Name() const { return data()->Is##Name(); } \
Name##Ref ObjectRef::As##Name() const { \
DCHECK(Is##Name()); \
return Name##Ref(broker(), data()); \
}
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DEFINE_IS_AND_AS)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(DEFINE_IS_AND_AS)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(DEFINE_IS_AND_AS)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(DEFINE_IS_AND_AS)
HEAP_BROKER_OBJECT_LIST(DEFINE_IS_AND_AS)
#undef DEFINE_IS_AND_AS
bool ObjectRef::IsSmi() const { return data()->is_smi(); }
......@@ -4236,7 +4260,7 @@ Handle<Object> ObjectRef::object() const {
}
#ifdef DEBUG
#define DEF_OBJECT_GETTER(T) \
#define DEF_OBJECT_GETTER(T, ...) \
Handle<T> T##Ref::object() const { \
if (broker()->mode() == JSHeapBroker::kSerialized && \
data_->used_status == ObjectData::Usage::kUnused) { \
......@@ -4245,16 +4269,13 @@ Handle<Object> ObjectRef::object() const {
return Handle<T>(reinterpret_cast<Address*>(data_->object().address())); \
}
#else
#define DEF_OBJECT_GETTER(T) \
#define DEF_OBJECT_GETTER(T, ...) \
Handle<T> T##Ref::object() const { \
return Handle<T>(reinterpret_cast<Address*>(data_->object().address())); \
}
#endif // DEBUG
HEAP_BROKER_SERIALIZED_OBJECT_LIST(DEF_OBJECT_GETTER)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(DEF_OBJECT_GETTER)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(DEF_OBJECT_GETTER)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(DEF_OBJECT_GETTER)
HEAP_BROKER_OBJECT_LIST(DEF_OBJECT_GETTER)
#undef DEF_OBJECT_GETTER
JSHeapBroker* ObjectRef::broker() const { return broker_; }
......
......@@ -62,87 +62,74 @@ enum class OddballType : uint8_t {
kOther // Oddball, but none of the above.
};
// This list is sorted such that subtypes appear before their supertypes.
// This list must not contain a type if it doesn't contain all of its subtypes
// too. For example, it CANNOT contain FixedArrayBase if it doesn't contain
// FixedDoubleArray, BytecodeArray and FixedArray.
// DO NOT VIOLATE THESE TWO PROPERTIES!
// Classes on this list will skip serialization when --concurrent-inlining is
// on. Otherwise, they might get serialized.
#define HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(V) \
/* Subtypes of FixedArray */ \
V(ObjectBoilerplateDescription) \
V(ScopeInfo) \
/* Subtypes of String */ \
V(InternalizedString) \
/* Subtypes of FixedArrayBase */ \
V(BytecodeArray) \
/* Subtypes of Name */ \
V(String) \
V(Symbol) \
/* Subtypes of HeapObject */ \
V(AccessorInfo) \
V(ArrayBoilerplateDescription) \
V(CallHandlerInfo) \
V(Cell) \
V(Code) \
V(DescriptorArray) \
V(FeedbackCell) \
V(FeedbackVector) \
V(FunctionTemplateInfo) \
V(Name) \
V(RegExpBoilerplateDescription) \
V(SharedFunctionInfo) \
V(TemplateObjectDescription)
// This list is sorted such that subtypes appear before their supertypes.
// DO NOT VIOLATE THIS PROPERTY!
// Classes in this list behave like serialized classes, but they allow lazy
// serialization from background threads where this is safe (e.g. for objects
// that are immutable and fully initialized once visible). Pass
// ObjectRef::BackgroundSerialization::kAllowed to the ObjectRef constructor
// for objects where serialization from the background thread is safe.
#define HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(V) \
/* Subtypes of HeapObject */ \
V(BigInt) \
V(HeapNumber)
// This list is sorted such that subtypes appear before their supertypes.
// DO NOT VIOLATE THIS PROPERTY!
// Types in this list can be serialized on demand from the background thread.
#define HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(V) \
/* Subtypes of HeapObject */ \
V(Map) \
V(PropertyCell)
enum class RefSerializationKind {
// Will skip serialization when --concurrent-inlining is on. Otherwise, they
// might get serialized. (The cake is a lie.)
kNeverSerialized,
// Can be serialized on demand from the background thread.
kBackgroundSerialized,
// Behave like serialized classes, but allow lazy serialization from
// background threads where this is safe (e.g. for objects that are immutable
// and fully initialized once visible). Pass
// ObjectRef::BackgroundSerialization::kAllowed to the ObjectRef constructor
// for objects where serialization from the background thread is safe.
kPossiblyBackgroundSerialized,
kSerialized,
};
// This list is sorted such that subtypes appear before their supertypes.
// DO NOT VIOLATE THIS PROPERTY!
#define HEAP_BROKER_SERIALIZED_OBJECT_LIST(V) \
/* Subtypes of JSObject */ \
V(JSArray) \
V(JSBoundFunction) \
V(JSDataView) \
V(JSFunction) \
V(JSGlobalObject) \
V(JSGlobalProxy) \
V(JSTypedArray) \
/* Subtypes of Context */ \
V(NativeContext) \
/* Subtypes of FixedArray */ \
V(Context) \
V(ScriptContextTable) \
/* Subtypes of FixedArrayBase */ \
V(FixedArray) \
V(FixedDoubleArray) \
/* Subtypes of JSReceiver */ \
V(JSObject) \
/* Subtypes of HeapObject */ \
V(AllocationSite) \
V(FixedArrayBase) \
V(JSReceiver) \
V(SourceTextModule) \
/* Subtypes of Object */ \
V(HeapObject)
#define HEAP_BROKER_OBJECT_LIST(V) \
/* Subtypes of JSObject */ \
V(JSArray, RefSerializationKind::kSerialized) \
V(JSBoundFunction, RefSerializationKind::kSerialized) \
V(JSDataView, RefSerializationKind::kSerialized) \
V(JSFunction, RefSerializationKind::kSerialized) \
V(JSGlobalObject, RefSerializationKind::kSerialized) \
V(JSGlobalProxy, RefSerializationKind::kSerialized) \
V(JSTypedArray, RefSerializationKind::kSerialized) \
/* Subtypes of Context */ \
V(NativeContext, RefSerializationKind::kSerialized) \
/* Subtypes of FixedArray */ \
V(Context, RefSerializationKind::kSerialized) \
V(ObjectBoilerplateDescription, RefSerializationKind::kNeverSerialized) \
V(ScopeInfo, RefSerializationKind::kNeverSerialized) \
V(ScriptContextTable, RefSerializationKind::kSerialized) \
/* Subtypes of String */ \
V(InternalizedString, RefSerializationKind::kNeverSerialized) \
/* Subtypes of FixedArrayBase */ \
V(BytecodeArray, RefSerializationKind::kNeverSerialized) \
V(FixedArray, RefSerializationKind::kSerialized) \
V(FixedDoubleArray, RefSerializationKind::kSerialized) \
/* Subtypes of Name */ \
V(String, RefSerializationKind::kNeverSerialized) \
V(Symbol, RefSerializationKind::kNeverSerialized) \
/* Subtypes of JSReceiver */ \
V(JSObject, RefSerializationKind::kSerialized) \
/* Subtypes of HeapObject */ \
V(AccessorInfo, RefSerializationKind::kNeverSerialized) \
V(AllocationSite, RefSerializationKind::kSerialized) \
V(ArrayBoilerplateDescription, RefSerializationKind::kNeverSerialized) \
V(BigInt, RefSerializationKind::kPossiblyBackgroundSerialized) \
V(CallHandlerInfo, RefSerializationKind::kNeverSerialized) \
V(Cell, RefSerializationKind::kNeverSerialized) \
V(Code, RefSerializationKind::kNeverSerialized) \
V(DescriptorArray, RefSerializationKind::kNeverSerialized) \
V(FeedbackCell, RefSerializationKind::kNeverSerialized) \
V(FeedbackVector, RefSerializationKind::kNeverSerialized) \
V(FixedArrayBase, RefSerializationKind::kSerialized) \
V(FunctionTemplateInfo, RefSerializationKind::kNeverSerialized) \
V(HeapNumber, RefSerializationKind::kPossiblyBackgroundSerialized) \
V(JSReceiver, RefSerializationKind::kSerialized) \
V(Map, RefSerializationKind::kBackgroundSerialized) \
V(Name, RefSerializationKind::kNeverSerialized) \
V(PropertyCell, RefSerializationKind::kBackgroundSerialized) \
V(RegExpBoilerplateDescription, RefSerializationKind::kNeverSerialized) \
V(SharedFunctionInfo, RefSerializationKind::kNeverSerialized) \
V(SourceTextModule, RefSerializationKind::kSerialized) \
V(TemplateObjectDescription, RefSerializationKind::kNeverSerialized) \
/* Subtypes of Object */ \
V(HeapObject, RefSerializationKind::kSerialized)
class CompilationDependencies;
struct FeedbackSource;
......@@ -150,11 +137,8 @@ class JSHeapBroker;
class ObjectData;
class PerIsolateCompilerCache;
class PropertyAccessInfo;
#define FORWARD_DECL(Name) class Name##Ref;
HEAP_BROKER_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(FORWARD_DECL)
#define FORWARD_DECL(Name, ...) class Name##Ref;
HEAP_BROKER_OBJECT_LIST(FORWARD_DECL)
#undef FORWARD_DECL
class V8_EXPORT_PRIVATE ObjectRef {
......@@ -180,18 +164,12 @@ class V8_EXPORT_PRIVATE ObjectRef {
bool IsSmi() const;
int AsSmi() const;
#define HEAP_IS_METHOD_DECL(Name) bool Is##Name() const;
HEAP_BROKER_SERIALIZED_OBJECT_LIST(HEAP_IS_METHOD_DECL)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(HEAP_IS_METHOD_DECL)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(HEAP_IS_METHOD_DECL)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(HEAP_IS_METHOD_DECL)
#define HEAP_IS_METHOD_DECL(Name, ...) bool Is##Name() const;
HEAP_BROKER_OBJECT_LIST(HEAP_IS_METHOD_DECL)
#undef HEAP_IS_METHOD_DECL
#define HEAP_AS_METHOD_DECL(Name) Name##Ref As##Name() const;
HEAP_BROKER_SERIALIZED_OBJECT_LIST(HEAP_AS_METHOD_DECL)
HEAP_BROKER_POSSIBLY_BACKGROUND_SERIALIZED_OBJECT_LIST(HEAP_AS_METHOD_DECL)
HEAP_BROKER_BACKGROUND_SERIALIZED_OBJECT_LIST(HEAP_AS_METHOD_DECL)
HEAP_BROKER_NEVER_SERIALIZED_OBJECT_LIST(HEAP_AS_METHOD_DECL)
#define HEAP_AS_METHOD_DECL(Name, ...) Name##Ref As##Name() const;
HEAP_BROKER_OBJECT_LIST(HEAP_AS_METHOD_DECL)
#undef HEAP_AS_METHOD_DECL
bool IsNull() const;
......
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