Commit bad9f981 authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[compiler] Background-serialize: HeapObject,JSReceiver,FixedArrayBase

Bug: v8:7790
Change-Id: I388a833810b3620eddcecc24fd571eda146fb785
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2843353Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#74172}
parent 10ca48ff
......@@ -369,8 +369,8 @@ void CallHandlerInfoData::Serialize(JSHeapBroker* broker) {
class JSReceiverData : public HeapObjectData {
public:
JSReceiverData(JSHeapBroker* broker, ObjectData** storage,
Handle<JSReceiver> object)
: HeapObjectData(broker, storage, object) {}
Handle<JSReceiver> object, ObjectDataKind kind)
: HeapObjectData(broker, storage, object, kind) {}
};
class JSObjectData : public JSReceiverData {
......@@ -1663,8 +1663,9 @@ void FeedbackVectorData::Serialize(JSHeapBroker* broker) {
class FixedArrayBaseData : public HeapObjectData {
public:
FixedArrayBaseData(JSHeapBroker* broker, ObjectData** storage,
Handle<FixedArrayBase> object)
: HeapObjectData(broker, storage, object), length_(object->length()) {}
Handle<FixedArrayBase> object, ObjectDataKind kind)
: HeapObjectData(broker, storage, object, kind),
length_(object->length()) {}
int length() const { return length_; }
......@@ -1743,14 +1744,17 @@ bool JSBoundFunctionData::Serialize(JSHeapBroker* broker) {
JSObjectData::JSObjectData(JSHeapBroker* broker, ObjectData** storage,
Handle<JSObject> object)
: JSReceiverData(broker, storage, object),
: JSReceiverData(broker, storage, object,
ObjectDataKind::kSerializedHeapObject),
inobject_fields_(broker->zone()),
own_constant_elements_(broker->zone()),
own_properties_(broker->zone()) {}
FixedArrayData::FixedArrayData(JSHeapBroker* broker, ObjectData** storage,
Handle<FixedArray> object)
: FixedArrayBaseData(broker, storage, object), contents_(broker->zone()) {}
: FixedArrayBaseData(broker, storage, object,
ObjectDataKind::kSerializedHeapObject),
contents_(broker->zone()) {}
void FixedArrayData::SerializeContents(JSHeapBroker* broker) {
if (serialized_contents_) return;
......@@ -1787,7 +1791,9 @@ class FixedDoubleArrayData : public FixedArrayBaseData {
FixedDoubleArrayData::FixedDoubleArrayData(JSHeapBroker* broker,
ObjectData** storage,
Handle<FixedDoubleArray> object)
: FixedArrayBaseData(broker, storage, object), contents_(broker->zone()) {}
: FixedArrayBaseData(broker, storage, object,
ObjectDataKind::kSerializedHeapObject),
contents_(broker->zone()) {}
void FixedDoubleArrayData::SerializeContents(JSHeapBroker* broker) {
if (serialized_contents_) return;
......@@ -1815,7 +1821,8 @@ class BytecodeArrayData : public FixedArrayBaseData {
BytecodeArrayData(JSHeapBroker* broker, ObjectData** storage,
Handle<BytecodeArray> object)
: FixedArrayBaseData(broker, storage, object),
: FixedArrayBaseData(broker, storage, object,
ObjectDataKind::kNeverSerializedHeapObject),
register_count_(object->register_count()),
parameter_count_(object->parameter_count()),
incoming_new_target_or_generator_register_(
......@@ -2752,7 +2759,8 @@ struct CreateDataFunctor<RefSerializationKind::kBackgroundSerialized, DataT,
} 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));
broker, &entry->value, Handle<ObjectT>::cast(object),
ObjectDataKind::kSerializedHeapObject);
*entry_out = entry;
return true;
}
......
......@@ -117,10 +117,10 @@ enum class RefSerializationKind {
V(DescriptorArray, RefSerializationKind::kNeverSerialized) \
V(FeedbackCell, RefSerializationKind::kNeverSerialized) \
V(FeedbackVector, RefSerializationKind::kNeverSerialized) \
V(FixedArrayBase, RefSerializationKind::kSerialized) \
V(FixedArrayBase, RefSerializationKind::kBackgroundSerialized) \
V(FunctionTemplateInfo, RefSerializationKind::kNeverSerialized) \
V(HeapNumber, RefSerializationKind::kPossiblyBackgroundSerialized) \
V(JSReceiver, RefSerializationKind::kSerialized) \
V(JSReceiver, RefSerializationKind::kBackgroundSerialized) \
V(Map, RefSerializationKind::kBackgroundSerialized) \
V(Name, RefSerializationKind::kNeverSerialized) \
V(PropertyCell, RefSerializationKind::kBackgroundSerialized) \
......@@ -129,7 +129,7 @@ enum class RefSerializationKind {
V(SourceTextModule, RefSerializationKind::kSerialized) \
V(TemplateObjectDescription, RefSerializationKind::kNeverSerialized) \
/* Subtypes of Object */ \
V(HeapObject, RefSerializationKind::kSerialized)
V(HeapObject, RefSerializationKind::kBackgroundSerialized)
class CompilationDependencies;
struct FeedbackSource;
......
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