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 #include "src/lookup.h" | 5 #include "src/lookup.h" |
6 | 6 |
7 #include "src/bootstrapper.h" | 7 #include "src/bootstrapper.h" |
8 #include "src/deoptimizer.h" | 8 #include "src/deoptimizer.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
10 #include "src/field-type.h" | 10 #include "src/field-type.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 #endif | 301 #endif |
302 } | 302 } |
303 | 303 |
304 // Can only be called when the receiver is a JSObject. JSProxy has to be handled | 304 // Can only be called when the receiver is a JSObject. JSProxy has to be handled |
305 // via a trap. Adding properties to primitive values is not observable. | 305 // via a trap. Adding properties to primitive values is not observable. |
306 void LookupIterator::PrepareTransitionToDataProperty( | 306 void LookupIterator::PrepareTransitionToDataProperty( |
307 Handle<JSObject> receiver, Handle<Object> value, | 307 Handle<JSObject> receiver, Handle<Object> value, |
308 PropertyAttributes attributes, Object::StoreFromKeyed store_mode) { | 308 PropertyAttributes attributes, Object::StoreFromKeyed store_mode) { |
309 DCHECK(receiver.is_identical_to(GetStoreTarget())); | 309 DCHECK(receiver.is_identical_to(GetStoreTarget())); |
310 if (state_ == TRANSITION) return; | 310 if (state_ == TRANSITION) return; |
| 311 |
| 312 if (!IsElement() && name()->IsPrivate()) { |
| 313 attributes = static_cast<PropertyAttributes>(attributes | DONT_ENUM); |
| 314 } |
| 315 |
311 DCHECK(state_ != LookupIterator::ACCESSOR || | 316 DCHECK(state_ != LookupIterator::ACCESSOR || |
312 (GetAccessors()->IsAccessorInfo() && | 317 (GetAccessors()->IsAccessorInfo() && |
313 AccessorInfo::cast(*GetAccessors())->is_special_data_property())); | 318 AccessorInfo::cast(*GetAccessors())->is_special_data_property())); |
314 DCHECK_NE(INTEGER_INDEXED_EXOTIC, state_); | 319 DCHECK_NE(INTEGER_INDEXED_EXOTIC, state_); |
315 DCHECK(state_ == NOT_FOUND || !HolderIsReceiverOrHiddenPrototype()); | 320 DCHECK(state_ == NOT_FOUND || !HolderIsReceiverOrHiddenPrototype()); |
316 | 321 |
317 Handle<Map> map(receiver->map(), isolate_); | 322 Handle<Map> map(receiver->map(), isolate_); |
318 | 323 |
319 // Dictionary maps can always have additional data properties. | 324 // Dictionary maps can always have additional data properties. |
320 if (map->is_dictionary_map()) { | 325 if (map->is_dictionary_map()) { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 } | 445 } |
441 | 446 |
442 void LookupIterator::TransitionToAccessorProperty( | 447 void LookupIterator::TransitionToAccessorProperty( |
443 Handle<Object> getter, Handle<Object> setter, | 448 Handle<Object> getter, Handle<Object> setter, |
444 PropertyAttributes attributes) { | 449 PropertyAttributes attributes) { |
445 DCHECK(!getter->IsNull(isolate_) || !setter->IsNull(isolate_)); | 450 DCHECK(!getter->IsNull(isolate_) || !setter->IsNull(isolate_)); |
446 // Can only be called when the receiver is a JSObject. JSProxy has to be | 451 // Can only be called when the receiver is a JSObject. JSProxy has to be |
447 // handled via a trap. Adding properties to primitive values is not | 452 // handled via a trap. Adding properties to primitive values is not |
448 // observable. | 453 // observable. |
449 Handle<JSObject> receiver = GetStoreTarget(); | 454 Handle<JSObject> receiver = GetStoreTarget(); |
| 455 if (!IsElement() && name()->IsPrivate()) { |
| 456 attributes = static_cast<PropertyAttributes>(attributes | DONT_ENUM); |
| 457 } |
450 | 458 |
451 if (!IsElement() && !receiver->map()->is_dictionary_map()) { | 459 if (!IsElement() && !receiver->map()->is_dictionary_map()) { |
452 Handle<Map> old_map(receiver->map(), isolate_); | 460 Handle<Map> old_map(receiver->map(), isolate_); |
453 | 461 |
454 if (!holder_.is_identical_to(receiver)) { | 462 if (!holder_.is_identical_to(receiver)) { |
455 holder_ = receiver; | 463 holder_ = receiver; |
456 state_ = NOT_FOUND; | 464 state_ = NOT_FOUND; |
457 } else if (state_ == INTERCEPTOR) { | 465 } else if (state_ == INTERCEPTOR) { |
458 LookupInRegularHolder<false>(*old_map, *holder_); | 466 LookupInRegularHolder<false>(*old_map, *holder_); |
459 } | 467 } |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
836 : access_check_info->named_interceptor(); | 844 : access_check_info->named_interceptor(); |
837 if (interceptor) { | 845 if (interceptor) { |
838 return handle(InterceptorInfo::cast(interceptor), isolate_); | 846 return handle(InterceptorInfo::cast(interceptor), isolate_); |
839 } | 847 } |
840 } | 848 } |
841 return Handle<InterceptorInfo>(); | 849 return Handle<InterceptorInfo>(); |
842 } | 850 } |
843 | 851 |
844 } // namespace internal | 852 } // namespace internal |
845 } // namespace v8 | 853 } // namespace v8 |
OLD | NEW |