| 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/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
| 10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 void LookupIterator::PrepareForDataProperty(Handle<Object> value) { | 127 void LookupIterator::PrepareForDataProperty(Handle<Object> value) { |
| 128 DCHECK(state_ == DATA || state_ == ACCESSOR); | 128 DCHECK(state_ == DATA || state_ == ACCESSOR); |
| 129 DCHECK(HolderIsReceiverOrHiddenPrototype()); | 129 DCHECK(HolderIsReceiverOrHiddenPrototype()); |
| 130 | 130 |
| 131 Handle<JSObject> holder = GetHolder<JSObject>(); | 131 Handle<JSObject> holder = GetHolder<JSObject>(); |
| 132 | 132 |
| 133 if (IsElement()) { | 133 if (IsElement()) { |
| 134 ElementsKind kind = holder_map_->elements_kind(); | 134 ElementsKind kind = holder_map_->elements_kind(); |
| 135 ElementsKind to = value->OptimalElementsKind(); | 135 ElementsKind to = value->OptimalElementsKind(); |
| 136 if (IsHoleyElementsKind(kind)) to = GetHoleyElementsKind(to); | 136 if (IsHoleyElementsKind(kind)) to = GetHoleyElementsKind(to); |
| 137 to = IsMoreGeneralElementsKindTransition(kind, to) ? to : kind; | 137 to = GetMoreGeneralElementsKind(kind, to); |
| 138 JSObject::TransitionElementsKind(holder, to); | 138 JSObject::TransitionElementsKind(holder, to); |
| 139 holder_map_ = handle(holder->map(), isolate_); | 139 holder_map_ = handle(holder->map(), isolate_); |
| 140 | 140 |
| 141 // Copy the backing store if it is copy-on-write. | 141 // Copy the backing store if it is copy-on-write. |
| 142 if (IsFastSmiOrObjectElementsKind(to)) { | 142 if (IsFastSmiOrObjectElementsKind(to)) { |
| 143 JSObject::EnsureWritableFastElements(holder); | 143 JSObject::EnsureWritableFastElements(holder); |
| 144 } | 144 } |
| 145 | 145 |
| 146 } else { | 146 } else { |
| 147 if (holder_map_->is_dictionary_map()) return; | 147 if (holder_map_->is_dictionary_map()) return; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 543 case InterceptorState::kSkipNonMasking: | 543 case InterceptorState::kSkipNonMasking: |
| 544 return true; | 544 return true; |
| 545 case InterceptorState::kProcessNonMasking: | 545 case InterceptorState::kProcessNonMasking: |
| 546 return false; | 546 return false; |
| 547 } | 547 } |
| 548 } | 548 } |
| 549 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 549 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
| 550 } | 550 } |
| 551 } // namespace internal | 551 } // namespace internal |
| 552 } // namespace v8 | 552 } // namespace v8 |
| OLD | NEW |