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