OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_LOOKUP_H_ | 5 #ifndef V8_LOOKUP_H_ |
6 #define V8_LOOKUP_H_ | 6 #define V8_LOOKUP_H_ |
7 | 7 |
8 #include "src/factory.h" | 8 #include "src/factory.h" |
9 #include "src/globals.h" | 9 #include "src/globals.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 void PrepareTransitionToDataProperty(Handle<JSObject> receiver, | 207 void PrepareTransitionToDataProperty(Handle<JSObject> receiver, |
208 Handle<Object> value, | 208 Handle<Object> value, |
209 PropertyAttributes attributes, | 209 PropertyAttributes attributes, |
210 Object::StoreFromKeyed store_mode); | 210 Object::StoreFromKeyed store_mode); |
211 bool IsCacheableTransition() { | 211 bool IsCacheableTransition() { |
212 DCHECK_EQ(TRANSITION, state_); | 212 DCHECK_EQ(TRANSITION, state_); |
213 return transition_->IsPropertyCell() || | 213 return transition_->IsPropertyCell() || |
214 (!transition_map()->is_dictionary_map() && | 214 (!transition_map()->is_dictionary_map() && |
215 transition_map()->GetBackPointer()->IsMap()); | 215 transition_map()->GetBackPointer()->IsMap()); |
216 } | 216 } |
| 217 bool IsInitializingStoreRequired() { |
| 218 DCHECK(IsFound()); |
| 219 return !IsElement() && !is_dictionary_holder() && representation().IsNone(); |
| 220 } |
217 void ApplyTransitionToDataProperty(Handle<JSObject> receiver); | 221 void ApplyTransitionToDataProperty(Handle<JSObject> receiver); |
218 void ReconfigureDataProperty(Handle<Object> value, | 222 void ReconfigureDataProperty(Handle<Object> value, |
219 PropertyAttributes attributes); | 223 PropertyAttributes attributes); |
220 void Delete(); | 224 void Delete(); |
221 void TransitionToAccessorProperty(Handle<Object> getter, | 225 void TransitionToAccessorProperty(Handle<Object> getter, |
222 Handle<Object> setter, | 226 Handle<Object> setter, |
223 PropertyAttributes attributes); | 227 PropertyAttributes attributes); |
224 void TransitionToAccessorPair(Handle<Object> pair, | 228 void TransitionToAccessorPair(Handle<Object> pair, |
225 PropertyAttributes attributes); | 229 PropertyAttributes attributes); |
226 PropertyDetails property_details() const { | 230 PropertyDetails property_details() const { |
227 DCHECK(has_property_); | 231 DCHECK(has_property_); |
228 return property_details_; | 232 return property_details_; |
229 } | 233 } |
230 PropertyAttributes property_attributes() const { | 234 PropertyAttributes property_attributes() const { |
231 return property_details().attributes(); | 235 return property_details().attributes(); |
232 } | 236 } |
233 bool IsConfigurable() const { return property_details().IsConfigurable(); } | 237 bool IsConfigurable() const { return property_details().IsConfigurable(); } |
234 bool IsReadOnly() const { return property_details().IsReadOnly(); } | 238 bool IsReadOnly() const { return property_details().IsReadOnly(); } |
235 bool IsEnumerable() const { return property_details().IsEnumerable(); } | 239 bool IsEnumerable() const { return property_details().IsEnumerable(); } |
236 Representation representation() const { | 240 Representation representation() const { |
237 return property_details().representation(); | 241 return property_details().representation(); |
238 } | 242 } |
| 243 PropertyConstness constness() const { return property_details().constness(); } |
239 FieldIndex GetFieldIndex() const; | 244 FieldIndex GetFieldIndex() const; |
240 Handle<FieldType> GetFieldType() const; | 245 Handle<FieldType> GetFieldType() const; |
241 int GetFieldDescriptorIndex() const; | 246 int GetFieldDescriptorIndex() const; |
242 int GetAccessorIndex() const; | 247 int GetAccessorIndex() const; |
243 int GetConstantIndex() const; | 248 int GetConstantIndex() const; |
244 Handle<PropertyCell> GetPropertyCell() const; | 249 Handle<PropertyCell> GetPropertyCell() const; |
245 Handle<Object> GetAccessors() const; | 250 Handle<Object> GetAccessors() const; |
246 inline Handle<InterceptorInfo> GetInterceptor() const { | 251 inline Handle<InterceptorInfo> GetInterceptor() const { |
247 DCHECK_EQ(INTERCEPTOR, state_); | 252 DCHECK_EQ(INTERCEPTOR, state_); |
248 InterceptorInfo* result = | 253 InterceptorInfo* result = |
249 IsElement() ? GetInterceptor<true>(JSObject::cast(*holder_)) | 254 IsElement() ? GetInterceptor<true>(JSObject::cast(*holder_)) |
250 : GetInterceptor<false>(JSObject::cast(*holder_)); | 255 : GetInterceptor<false>(JSObject::cast(*holder_)); |
251 return handle(result, isolate_); | 256 return handle(result, isolate_); |
252 } | 257 } |
253 Handle<InterceptorInfo> GetInterceptorForFailedAccessCheck() const; | 258 Handle<InterceptorInfo> GetInterceptorForFailedAccessCheck() const; |
254 Handle<Object> GetDataValue() const; | 259 Handle<Object> GetDataValue() const; |
255 void WriteDataValue(Handle<Object> value); | 260 void WriteDataValue(Handle<Object> value, bool initializing_store); |
256 inline void UpdateProtector() { | 261 inline void UpdateProtector() { |
257 if (IsElement()) return; | 262 if (IsElement()) return; |
258 if (*name_ == heap()->is_concat_spreadable_symbol() || | 263 if (*name_ == heap()->is_concat_spreadable_symbol() || |
259 *name_ == heap()->constructor_string() || | 264 *name_ == heap()->constructor_string() || |
260 *name_ == heap()->species_symbol() || | 265 *name_ == heap()->species_symbol() || |
261 *name_ == heap()->has_instance_symbol() || | 266 *name_ == heap()->has_instance_symbol() || |
262 *name_ == heap()->iterator_symbol()) { | 267 *name_ == heap()->iterator_symbol()) { |
263 InternalUpdateProtector(); | 268 InternalUpdateProtector(); |
264 } | 269 } |
265 } | 270 } |
(...skipping 30 matching lines...) Expand all Loading... |
296 State LookupInRegularHolder(Map* map, JSReceiver* holder); | 301 State LookupInRegularHolder(Map* map, JSReceiver* holder); |
297 template <bool is_element> | 302 template <bool is_element> |
298 State LookupInSpecialHolder(Map* map, JSReceiver* holder); | 303 State LookupInSpecialHolder(Map* map, JSReceiver* holder); |
299 template <bool is_element> | 304 template <bool is_element> |
300 void RestartLookupForNonMaskingInterceptors() { | 305 void RestartLookupForNonMaskingInterceptors() { |
301 RestartInternal<is_element>(InterceptorState::kProcessNonMasking); | 306 RestartInternal<is_element>(InterceptorState::kProcessNonMasking); |
302 } | 307 } |
303 template <bool is_element> | 308 template <bool is_element> |
304 void RestartInternal(InterceptorState interceptor_state); | 309 void RestartInternal(InterceptorState interceptor_state); |
305 Handle<Object> FetchValue() const; | 310 Handle<Object> FetchValue() const; |
| 311 bool IsConstFieldValueEqualTo(Object* value) const; |
306 template <bool is_element> | 312 template <bool is_element> |
307 void ReloadPropertyInformation(); | 313 void ReloadPropertyInformation(); |
308 | 314 |
309 template <bool is_element> | 315 template <bool is_element> |
310 bool SkipInterceptor(JSObject* holder); | 316 bool SkipInterceptor(JSObject* holder); |
311 template <bool is_element> | 317 template <bool is_element> |
312 inline InterceptorInfo* GetInterceptor(JSObject* holder) const { | 318 inline InterceptorInfo* GetInterceptor(JSObject* holder) const { |
313 return is_element ? holder->GetIndexedInterceptor() | 319 return is_element ? holder->GetIndexedInterceptor() |
314 : holder->GetNamedInterceptor(); | 320 : holder->GetNamedInterceptor(); |
315 } | 321 } |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 const Handle<JSReceiver> initial_holder_; | 367 const Handle<JSReceiver> initial_holder_; |
362 const uint32_t index_; | 368 const uint32_t index_; |
363 uint32_t number_; | 369 uint32_t number_; |
364 }; | 370 }; |
365 | 371 |
366 | 372 |
367 } // namespace internal | 373 } // namespace internal |
368 } // namespace v8 | 374 } // namespace v8 |
369 | 375 |
370 #endif // V8_LOOKUP_H_ | 376 #endif // V8_LOOKUP_H_ |
OLD | NEW |