Commit b7364a49 authored by Georg Neis's avatar Georg Neis Committed by V8 LUCI CQ

[compiler] Simplify StringRef

... by removing some obsolete code.

Bug: v8:7790
Change-Id: I3a244ef5fc7fe15321e5bb1c9bb2fe794030ba3b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3124801
Commit-Queue: Georg Neis <neis@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76582}
parent 19d89456
...@@ -363,18 +363,6 @@ void JSObjectData::SerializeObjectCreateMap(JSHeapBroker* broker, ...@@ -363,18 +363,6 @@ void JSObjectData::SerializeObjectCreateMap(JSHeapBroker* broker,
namespace { namespace {
base::Optional<ObjectRef> GetOwnElementFromHeap(JSHeapBroker* broker,
Handle<Object> receiver,
uint32_t index,
bool constant_only) {
LookupIterator it(broker->isolate(), receiver, index, LookupIterator::OWN);
if (it.state() == LookupIterator::DATA &&
(!constant_only || (it.IsReadOnly() && !it.IsConfigurable()))) {
return MakeRef(broker, it.GetDataValue());
}
return base::nullopt;
}
base::Optional<ObjectRef> GetOwnFastDataPropertyFromHeap( base::Optional<ObjectRef> GetOwnFastDataPropertyFromHeap(
JSHeapBroker* broker, JSObjectRef holder, Representation representation, JSHeapBroker* broker, JSObjectRef holder, Representation representation,
FieldIndex field_index) { FieldIndex field_index) {
...@@ -1797,8 +1785,8 @@ ObjectRef MapRef::GetFieldType(InternalIndex descriptor_index) const { ...@@ -1797,8 +1785,8 @@ ObjectRef MapRef::GetFieldType(InternalIndex descriptor_index) const {
} }
base::Optional<ObjectRef> StringRef::GetCharAsStringOrUndefined( base::Optional<ObjectRef> StringRef::GetCharAsStringOrUndefined(
uint32_t index, SerializationPolicy policy) const { uint32_t index) const {
if (broker()->is_concurrent_inlining()) { DCHECK(data_->should_access_heap() || broker()->is_concurrent_inlining());
String maybe_char; String maybe_char;
auto result = ConcurrentLookupIterator::TryGetOwnChar( auto result = ConcurrentLookupIterator::TryGetOwnChar(
&maybe_char, broker()->isolate(), broker()->local_isolate(), *object(), &maybe_char, broker()->isolate(), broker()->local_isolate(), *object(),
...@@ -1812,10 +1800,6 @@ base::Optional<ObjectRef> StringRef::GetCharAsStringOrUndefined( ...@@ -1812,10 +1800,6 @@ base::Optional<ObjectRef> StringRef::GetCharAsStringOrUndefined(
DCHECK_EQ(result, ConcurrentLookupIterator::kPresent); DCHECK_EQ(result, ConcurrentLookupIterator::kPresent);
return TryMakeRef(broker(), maybe_char); return TryMakeRef(broker(), maybe_char);
}
CHECK_EQ(data_->kind(), ObjectDataKind::kUnserializedHeapObject);
return GetOwnElementFromHeap(broker(), object(), index, true);
} }
bool StringRef::SupportedStringKind() const { bool StringRef::SupportedStringKind() const {
......
...@@ -55,8 +55,6 @@ inline bool IsAnyStore(AccessMode mode) { ...@@ -55,8 +55,6 @@ inline bool IsAnyStore(AccessMode mode) {
return mode == AccessMode::kStore || mode == AccessMode::kStoreInLiteral; return mode == AccessMode::kStore || mode == AccessMode::kStoreInLiteral;
} }
enum class SerializationPolicy { kAssumeSerialized, kSerializeIfNeeded };
// Clarifies in function signatures that a method may only be called when // Clarifies in function signatures that a method may only be called when
// concurrent inlining is disabled. // concurrent inlining is disabled.
class NotConcurrentInliningTag final { class NotConcurrentInliningTag final {
...@@ -936,9 +934,7 @@ class StringRef : public NameRef { ...@@ -936,9 +934,7 @@ class StringRef : public NameRef {
// With concurrent inlining on, we return base::nullopt due to not being able // With concurrent inlining on, we return base::nullopt due to not being able
// to use LookupIterator in a thread-safe way. // to use LookupIterator in a thread-safe way.
base::Optional<ObjectRef> GetCharAsStringOrUndefined( base::Optional<ObjectRef> GetCharAsStringOrUndefined(uint32_t index) const;
uint32_t index, SerializationPolicy policy =
SerializationPolicy::kAssumeSerialized) const;
// When concurrently accessing non-read-only non-supported strings, we return // When concurrently accessing non-read-only non-supported strings, we return
// base::nullopt for these methods. // base::nullopt for these methods.
......
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