Commit 21f09a75 authored by Santiago Aboy Solanes's avatar Santiago Aboy Solanes Committed by Commit Bot

[compiler] Move String and Name to kNeverSerialized

Bug: v8:7790
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_isolates_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_no_cm_rel_ng
Cq-Include-Trybots: luci.v8.try:v8_linux64_tsan_rel_ng
Change-Id: I950ffddcf135ede1af8a2409461868d458eac3c8
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2726498
Commit-Queue: Santiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#73096}
parent bf43d206
...@@ -76,6 +76,7 @@ enum class OddballType : uint8_t { ...@@ -76,6 +76,7 @@ enum class OddballType : uint8_t {
/* Subtypes of FixedArrayBase */ \ /* Subtypes of FixedArrayBase */ \
V(BytecodeArray) \ V(BytecodeArray) \
/* Subtypes of Name */ \ /* Subtypes of Name */ \
V(String) \
V(Symbol) \ V(Symbol) \
/* Subtypes of HeapObject */ \ /* Subtypes of HeapObject */ \
V(AccessorInfo) \ V(AccessorInfo) \
...@@ -85,6 +86,7 @@ enum class OddballType : uint8_t { ...@@ -85,6 +86,7 @@ enum class OddballType : uint8_t {
V(Code) \ V(Code) \
V(FeedbackCell) \ V(FeedbackCell) \
V(FeedbackVector) \ V(FeedbackVector) \
V(Name) \
V(RegExpBoilerplateDescription) \ V(RegExpBoilerplateDescription) \
V(SharedFunctionInfo) \ V(SharedFunctionInfo) \
V(TemplateObjectDescription) V(TemplateObjectDescription)
...@@ -128,8 +130,6 @@ enum class OddballType : uint8_t { ...@@ -128,8 +130,6 @@ enum class OddballType : uint8_t {
/* Subtypes of FixedArrayBase */ \ /* Subtypes of FixedArrayBase */ \
V(FixedArray) \ V(FixedArray) \
V(FixedDoubleArray) \ V(FixedDoubleArray) \
/* Subtypes of Name */ \
V(String) \
/* Subtypes of JSReceiver */ \ /* Subtypes of JSReceiver */ \
V(JSObject) \ V(JSObject) \
/* Subtypes of HeapObject */ \ /* Subtypes of HeapObject */ \
...@@ -138,7 +138,6 @@ enum class OddballType : uint8_t { ...@@ -138,7 +138,6 @@ enum class OddballType : uint8_t {
V(FixedArrayBase) \ V(FixedArrayBase) \
V(FunctionTemplateInfo) \ V(FunctionTemplateInfo) \
V(JSReceiver) \ V(JSReceiver) \
V(Name) \
V(SourceTextModule) \ V(SourceTextModule) \
/* Subtypes of Object */ \ /* Subtypes of Object */ \
V(HeapObject) V(HeapObject)
...@@ -910,13 +909,18 @@ class StringRef : public NameRef { ...@@ -910,13 +909,18 @@ class StringRef : public NameRef {
Handle<String> object() const; Handle<String> object() const;
// With concurrent inlining on, we return base::nullopt due to not being able
// to use LookupIterator in a thread-safe way.
base::Optional<ObjectRef> GetCharAsStringOrUndefined( base::Optional<ObjectRef> GetCharAsStringOrUndefined(
uint32_t index, SerializationPolicy policy = uint32_t index, SerializationPolicy policy =
SerializationPolicy::kAssumeSerialized) const; SerializationPolicy::kAssumeSerialized) const;
// When concurrently accessing non-read-only non-internalized strings, we
// return base::nullopt for these methods.
base::Optional<int> length() const; base::Optional<int> length() const;
base::Optional<uint16_t> GetFirstChar(); base::Optional<uint16_t> GetFirstChar();
base::Optional<double> ToNumber(); base::Optional<double> ToNumber();
bool IsSeqString() const; bool IsSeqString() const;
bool IsExternalString() const; bool IsExternalString() const;
}; };
......
...@@ -849,7 +849,9 @@ class NativeContextData : public ContextData { ...@@ -849,7 +849,9 @@ class NativeContextData : public ContextData {
class NameData : public HeapObjectData { class NameData : public HeapObjectData {
public: public:
NameData(JSHeapBroker* broker, ObjectData** storage, Handle<Name> object) NameData(JSHeapBroker* broker, ObjectData** storage, Handle<Name> object)
: HeapObjectData(broker, storage, object) {} : HeapObjectData(broker, storage, object) {
DCHECK(!FLAG_turbo_direct_heap_access);
}
}; };
class StringData : public NameData { class StringData : public NameData {
...@@ -895,7 +897,9 @@ StringData::StringData(JSHeapBroker* broker, ObjectData** storage, ...@@ -895,7 +897,9 @@ StringData::StringData(JSHeapBroker* broker, ObjectData** storage,
to_number_(TryStringToDouble(broker->local_isolate(), object)), to_number_(TryStringToDouble(broker->local_isolate(), object)),
is_external_string_(object->IsExternalString()), is_external_string_(object->IsExternalString()),
is_seq_string_(object->IsSeqString()), is_seq_string_(object->IsSeqString()),
chars_as_strings_(broker->zone()) {} chars_as_strings_(broker->zone()) {
DCHECK(!FLAG_turbo_direct_heap_access);
}
class InternalizedStringData : public StringData { class InternalizedStringData : public StringData {
public: public:
...@@ -4207,15 +4211,11 @@ bool NameRef::IsUniqueName() const { ...@@ -4207,15 +4211,11 @@ bool NameRef::IsUniqueName() const {
void RegExpBoilerplateDescriptionRef::Serialize() { void RegExpBoilerplateDescriptionRef::Serialize() {
if (data_->should_access_heap()) { if (data_->should_access_heap()) {
// Even if the regexp boilerplate object itself is no longer serialized, // Even if the regexp boilerplate object itself is no longer serialized,
// both `data` and `source` fields still are and thus we need to make sure // the `data` still is and thus we need to make sure to visit it.
// to visit them. // TODO(jgruber,v8:7790): Remove once it is no longer a serialized type.
// TODO(jgruber,v8:7790): Remove once these are no longer serialized types.
STATIC_ASSERT(IsSerializedHeapObject<FixedArray>()); STATIC_ASSERT(IsSerializedHeapObject<FixedArray>());
FixedArrayRef data_ref{ FixedArrayRef data_ref{
broker(), broker()->CanonicalPersistentHandle(object()->data())}; broker(), broker()->CanonicalPersistentHandle(object()->data())};
STATIC_ASSERT(IsSerializedHeapObject<String>());
StringRef source_ref{
broker(), broker()->CanonicalPersistentHandle(object()->source())};
} else { } else {
CHECK_EQ(broker()->mode(), JSHeapBroker::kSerializing); CHECK_EQ(broker()->mode(), JSHeapBroker::kSerializing);
HeapObjectRef::data()->AsRegExpBoilerplateDescription()->Serialize( HeapObjectRef::data()->AsRegExpBoilerplateDescription()->Serialize(
......
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