5#ifndef V8_OBJECTS_LOOKUP_H_
6#define V8_OBJECTS_LOOKUP_H_
18#if V8_ENABLE_WEBASSEMBLY
28 template <
template <
typename>
typename HandleType>
32 template <
typename T,
template <
typename>
typename HandleType>
36 template <
typename T,
template <
typename>
typename HandleType>
49 template <
template <
typename>
typename HandleType>
61 kInterceptor = 1 << 0,
62 kPrototypeChain = 1 << 1,
65 OWN_SKIP_INTERCEPTOR = 0,
67 PROTOTYPE_CHAIN_SKIP_INTERCEPTOR = kPrototypeChain,
68 PROTOTYPE_CHAIN = kPrototypeChain | kInterceptor,
69 DEFAULT = PROTOTYPE_CHAIN
112 BEFORE_PROPERTY = INTERCEPTOR
119 Configuration configuration = DEFAULT);
123 Configuration configuration = DEFAULT);
126 size_t index, Configuration configuration = DEFAULT);
129 Configuration configuration = DEFAULT);
133 Configuration configuration = DEFAULT);
137 Configuration configuration = DEFAULT);
148 IsElement() ? RestartInternal<true>(state) : RestartInternal<false>(state);
153 void RecheckTypedArrayBounds();
163 return static_cast<uint32_t
>(
index_);
177 inline bool IsPrivateName()
const;
182 has_property_ =
false;
192 inline bool is_dictionary_holder()
const;
199 return lookup_start_object_;
202 bool HolderIsReceiver()
const;
203 bool HolderIsReceiverOrHiddenPrototype()
const;
206 return (configuration_ & kPrototypeChain) != 0;
210 bool HasAccess()
const;
219 inline bool IsCacheableTransition();
231 return property_details_;
234 return property_details().attributes();
237 bool IsReadOnly()
const {
return property_details().IsReadOnly(); }
238 bool IsEnumerable()
const {
return property_details().IsEnumerable(); }
240 return property_details().representation();
245 int GetFieldDescriptorIndex()
const;
246 int GetAccessorIndex()
const;
252 AllocationPolicy::kAllocationAllowed)
const;
261 inline void UpdateProtector();
262 static inline void UpdateProtector(
Isolate* isolate,
269 bool TryLookupCachedProperty();
272 static bool HasInternalMarkerProperty(
Isolate* isolate,
279 static const size_t kInvalidIndex = std::numeric_limits<size_t>::max();
293 static void InternalUpdateProtector(
Isolate* isolate,
308 return is_element &&
index_ <= JSArray::kMaxArrayIndex;
310 template <
bool is_element>
312 template <
bool is_element>
314 template <
bool is_element>
317 ? LookupInSpecialHolder<is_element>(map, holder)
318 : LookupInRegularHolder<is_element>(map, holder);
320 template <
bool is_element>
322 template <
bool is_element>
324 template <
bool is_element>
326 RestartInternal<is_element>(InterceptorState::kProcessNonMasking);
328 template <
bool is_element>
329 void RestartInternal(InterceptorState interceptor_state);
332 AllocationPolicy::kAllocationAllowed)
const;
336 template <
bool is_element>
337 void ReloadPropertyInformation();
339 template <
bool is_element>
341 template <
bool is_element>
345 return (configuration_ & kInterceptor) != 0;
350 static inline Configuration ComputeConfiguration(
Isolate* isolate,
351 Configuration configuration,
356 size_t index, Configuration configuration);
359 Configuration configuration);
367 bool has_property_ =
false;
410 ElementsKind elements_kind,
int array_length,
size_t index);
static V8_EXPORT_PRIVATE std::optional< Tagged< Object > > TryGetOwnCowElement(Isolate *isolate, Tagged< FixedArray > array_elements, ElementsKind elements_kind, int array_length, size_t index)
static V8_EXPORT_PRIVATE Result TryGetOwnChar(Tagged< String > *result_out, Isolate *isolate, LocalIsolate *local_isolate, Tagged< String > string, size_t index)
static V8_EXPORT_PRIVATE Result TryGetOwnConstantElement(Tagged< Object > *result_out, Isolate *isolate, LocalIsolate *local_isolate, Tagged< JSObject > holder, Tagged< FixedArrayBase > elements, ElementsKind elements_kind, size_t index)
static V8_EXPORT_PRIVATE std::optional< Tagged< PropertyCell > > TryGetPropertyCell(Isolate *isolate, LocalIsolate *local_isolate, DirectHandle< JSGlobalObject > holder, DirectHandle< Name > name)
bool is_js_array_element(bool is_element) const
const Configuration configuration_
PropertyDetails property_details() const
DirectHandle< UnionOf< Map, PropertyCell > > transition_
uint32_t array_index() const
PropertyLocation location() const
bool check_interceptor() const
LookupIterator(Isolate *isolate, Configuration configuration, DirectHandle< JSAny > receiver, DirectHandle< Symbol > name, DirectHandle< JSAny > lookup_start_object)
Isolate * isolate() const
void RestartLookupForNonMaskingInterceptors()
PropertyAttributes property_attributes() const
DirectHandle< Name > name_
DirectHandle< JSReceiver > holder_
DirectHandle< JSAny > GetReceiver() const
const DirectHandle< JSAny > receiver_
State LookupInHolder(Tagged< Map > map, Tagged< JSReceiver > holder)
DirectHandle< JSAny > lookup_start_object() const
V8_EXPORT_PRIVATE void Start()
Factory * factory() const
@ TYPED_ARRAY_INDEX_NOT_FOUND
bool IsConfigurable() const
Representation representation() const
bool IsEnumerable() const
PropertyConstness constness() const
const DirectHandle< JSAny > lookup_start_object_
bool check_prototype_chain() const
DirectHandle< Name > name_
DirectHandle< Name > name() const
PropertyKey(Isolate *isolate, double index)
DirectHandle< Name > GetName(Isolate *isolate)
enum v8::internal::@1270::DeoptimizableCodeIterator::@67 state_
bool IsSpecialReceiverMap(Tagged< Map > map)
#define DCHECK_LE(v1, v2)
#define DCHECK(condition)
#define V8_EXPORT_PRIVATE
#define V8_WARN_UNUSED_RESULT
std::unique_ptr< ValueMirror > key