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 {
/* Subtypes of FixedArrayBase */ \
V(BytecodeArray) \
/* Subtypes of Name */ \
V(String) \
V(Symbol) \
/* Subtypes of HeapObject */ \
V(AccessorInfo) \
......@@ -85,6 +86,7 @@ enum class OddballType : uint8_t {
V(Code) \
V(FeedbackCell) \
V(FeedbackVector) \
V(Name) \
V(RegExpBoilerplateDescription) \
V(SharedFunctionInfo) \
V(TemplateObjectDescription)
......@@ -128,8 +130,6 @@ enum class OddballType : uint8_t {
/* Subtypes of FixedArrayBase */ \
V(FixedArray) \
V(FixedDoubleArray) \
/* Subtypes of Name */ \
V(String) \
/* Subtypes of JSReceiver */ \
V(JSObject) \
/* Subtypes of HeapObject */ \
......@@ -138,7 +138,6 @@ enum class OddballType : uint8_t {
V(FixedArrayBase) \
V(FunctionTemplateInfo) \
V(JSReceiver) \
V(Name) \
V(SourceTextModule) \
/* Subtypes of Object */ \
V(HeapObject)
......@@ -910,13 +909,18 @@ class StringRef : public NameRef {
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(
uint32_t index, SerializationPolicy policy =
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<uint16_t> GetFirstChar();
base::Optional<double> ToNumber();
bool IsSeqString() const;
bool IsExternalString() const;
};
......
......@@ -849,7 +849,9 @@ class NativeContextData : public ContextData {
class NameData : public HeapObjectData {
public:
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 {
......@@ -895,7 +897,9 @@ StringData::StringData(JSHeapBroker* broker, ObjectData** storage,
to_number_(TryStringToDouble(broker->local_isolate(), object)),
is_external_string_(object->IsExternalString()),
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 {
public:
......@@ -4207,15 +4211,11 @@ bool NameRef::IsUniqueName() const {
void RegExpBoilerplateDescriptionRef::Serialize() {
if (data_->should_access_heap()) {
// 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
// to visit them.
// TODO(jgruber,v8:7790): Remove once these are no longer serialized types.
// the `data` still is and thus we need to make sure to visit it.
// TODO(jgruber,v8:7790): Remove once it is no longer a serialized type.
STATIC_ASSERT(IsSerializedHeapObject<FixedArray>());
FixedArrayRef data_ref{
broker(), broker()->CanonicalPersistentHandle(object()->data())};
STATIC_ASSERT(IsSerializedHeapObject<String>());
StringRef source_ref{
broker(), broker()->CanonicalPersistentHandle(object()->source())};
} else {
CHECK_EQ(broker()->mode(), JSHeapBroker::kSerializing);
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