Commit eae14b55 authored by Shu-yu Guo's avatar Shu-yu Guo Committed by Commit Bot

Add Dictionary::RawFieldOfValueAt

For supporting use of dictionaries during GC, such as in the JS WeakRef
implementation.

Bug: v8:8179
Change-Id: Ide3f5c45d2602f13a1bcb1968b36f08881067090
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1972427Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Shu-yu Guo <syg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65498}
parent b15c02d0
...@@ -149,6 +149,12 @@ void Dictionary<Derived, Shape>::SetEntry(Isolate* isolate, InternalIndex entry, ...@@ -149,6 +149,12 @@ void Dictionary<Derived, Shape>::SetEntry(Isolate* isolate, InternalIndex entry,
if (Shape::kHasDetails) DetailsAtPut(isolate, entry, details); if (Shape::kHasDetails) DetailsAtPut(isolate, entry, details);
} }
template <typename Derived, typename Shape>
ObjectSlot Dictionary<Derived, Shape>::RawFieldOfValueAt(InternalIndex entry) {
return this->RawFieldOfElementAt(DerivedHashTable::EntryToIndex(entry) +
Derived::kEntryValueIndex);
}
template <typename Key> template <typename Key>
template <typename Dictionary> template <typename Dictionary>
PropertyDetails BaseDictionaryShape<Key>::DetailsAt(Dictionary dict, PropertyDetails BaseDictionaryShape<Key>::DetailsAt(Dictionary dict,
......
...@@ -70,6 +70,9 @@ class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) Dictionary ...@@ -70,6 +70,9 @@ class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) Dictionary
inline void SetEntry(Isolate* isolate, InternalIndex entry, Object key, inline void SetEntry(Isolate* isolate, InternalIndex entry, Object key,
Object value, PropertyDetails details); Object value, PropertyDetails details);
// Garbage collection support.
inline ObjectSlot RawFieldOfValueAt(InternalIndex entry);
V8_WARN_UNUSED_RESULT static Handle<Derived> Add( V8_WARN_UNUSED_RESULT static Handle<Derived> Add(
Isolate* isolate, Handle<Derived> dictionary, Key key, Isolate* isolate, Handle<Derived> dictionary, Key key,
Handle<Object> value, PropertyDetails details, Handle<Object> value, PropertyDetails details,
......
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