8 #include "src/globals.h" 9 #include "src/heap/factory.h" 10 #include "src/isolate.h" 11 #include "src/objects.h" 12 #include "src/objects/descriptor-array.h" 13 #include "src/objects/map.h" 22 kInterceptor = 1 << 0,
23 kPrototypeChain = 1 << 1,
26 OWN_SKIP_INTERCEPTOR = 0,
28 PROTOTYPE_CHAIN_SKIP_INTERCEPTOR = kPrototypeChain,
29 PROTOTYPE_CHAIN = kPrototypeChain | kInterceptor,
30 DEFAULT = PROTOTYPE_CHAIN
35 INTEGER_INDEXED_EXOTIC,
44 BEFORE_PROPERTY = INTERCEPTOR
49 Configuration configuration = DEFAULT);
53 Configuration configuration = DEFAULT);
57 Configuration configuration = DEFAULT);
60 uint32_t index, Configuration configuration = DEFAULT);
64 Configuration configuration = DEFAULT)
65 : configuration_(configuration),
66 interceptor_state_(InterceptorState::kUninitialized),
67 property_details_(PropertyDetails::Empty()),
70 initial_holder_(holder),
72 number_(static_cast<uint32_t>(DescriptorArray::kNotFound)) {
74 DCHECK_NE(kMaxUInt32, index_);
80 Configuration configuration = DEFAULT);
89 Configuration configuration = DEFAULT);
93 bool* success, Configuration configuration = DEFAULT);
100 InterceptorState state = InterceptorState::kUninitialized;
101 IsElement() ? RestartInternal<true>(state) : RestartInternal<false>(state);
104 Isolate* isolate()
const {
return isolate_; }
105 State state()
const {
return state_; }
108 DCHECK(!IsElement());
112 uint32_t index()
const {
return index_; }
114 bool IsElement()
const {
return index_ != kMaxUInt32; }
116 bool IsFound()
const {
return state_ != NOT_FOUND; }
119 has_property_ =
false;
123 Heap* heap()
const {
return isolate_->heap(); }
124 Factory* factory()
const {
return isolate_->factory(); }
129 inline bool is_dictionary_holder()
const;
135 bool HolderIsReceiver()
const;
136 bool HolderIsReceiverOrHiddenPrototype()
const;
138 bool check_prototype_chain()
const {
139 return (configuration_ & kPrototypeChain) != 0;
143 bool HasAccess()
const;
150 PropertyAttributes attributes,
151 StoreOrigin store_origin);
152 inline bool IsCacheableTransition();
155 PropertyAttributes attributes);
159 PropertyAttributes attributes);
161 PropertyAttributes attributes);
163 DCHECK(has_property_);
164 return property_details_;
166 PropertyAttributes property_attributes()
const {
167 return property_details().attributes();
169 bool IsConfigurable()
const {
return property_details().IsConfigurable(); }
170 bool IsReadOnly()
const {
return property_details().IsReadOnly(); }
171 bool IsEnumerable()
const {
return property_details().IsEnumerable(); }
173 return property_details().representation();
175 PropertyLocation location()
const {
return property_details().location(); }
176 PropertyConstness constness()
const {
return property_details().constness(); }
180 int GetFieldDescriptorIndex()
const;
181 int GetAccessorIndex()
const;
182 int GetConstantIndex()
const;
188 void WriteDataValue(
Handle<Object> value,
bool initializing_store);
189 inline void UpdateProtector();
193 bool TryLookupCachedProperty();
194 bool LookupCachedProperty();
202 void InternalUpdateProtector();
204 enum class InterceptorState {
212 V8_WARN_UNUSED_RESULT
inline JSReceiver* NextHolder(
Map map);
214 template <
bool is_element>
215 V8_EXPORT_PRIVATE
void Start();
216 template <
bool is_element>
218 template <
bool is_element>
220 return map->IsSpecialReceiverMap()
221 ? LookupInSpecialHolder<is_element>(map, holder)
222 : LookupInRegularHolder<is_element>(map, holder);
224 template <
bool is_element>
226 template <
bool is_element>
228 template <
bool is_element>
229 void RestartLookupForNonMaskingInterceptors() {
230 RestartInternal<is_element>(InterceptorState::kProcessNonMasking);
232 template <
bool is_element>
233 void RestartInternal(InterceptorState interceptor_state);
235 bool IsConstFieldValueEqualTo(
Object* value)
const;
236 template <
bool is_element>
237 void ReloadPropertyInformation();
239 template <
bool is_element>
240 bool SkipInterceptor(
JSObject* holder);
241 template <
bool is_element>
243 return is_element ? holder->GetIndexedInterceptor()
244 : holder->GetNamedInterceptor();
247 bool check_interceptor()
const {
248 return (configuration_ & kInterceptor) != 0;
250 inline int descriptor_number()
const;
251 inline int dictionary_entry()
const;
253 static inline Configuration ComputeConfiguration(
262 State NotFound(
JSReceiver*
const holder)
const;
266 const Configuration configuration_;
269 InterceptorState interceptor_state_;
285 #endif // V8_LOOKUP_H_