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/v8.h" | 5 #include "src/v8.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/lookup.h" | 9 #include "src/lookup.h" |
10 #include "src/lookup-inl.h" | 10 #include "src/lookup-inl.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 state_ = BEFORE_PROPERTY; | 110 state_ = BEFORE_PROPERTY; |
111 interceptor_state_ = InterceptorState::kUninitialized; | 111 interceptor_state_ = InterceptorState::kUninitialized; |
112 state_ = LookupInHolder(*holder_map_, *holder_); | 112 state_ = LookupInHolder(*holder_map_, *holder_); |
113 DCHECK(IsFound() || holder_map_->is_dictionary_map()); | 113 DCHECK(IsFound() || holder_map_->is_dictionary_map()); |
114 } | 114 } |
115 | 115 |
116 | 116 |
117 void LookupIterator::ReloadHolderMap() { | 117 void LookupIterator::ReloadHolderMap() { |
118 DCHECK_EQ(DATA, state_); | 118 DCHECK_EQ(DATA, state_); |
119 DCHECK(IsElement()); | 119 DCHECK(IsElement()); |
120 DCHECK(JSObject::cast(*holder_)->HasExternalArrayElements() || | 120 DCHECK(JSObject::cast(*holder_)->HasFixedTypedArrayElements()); |
121 JSObject::cast(*holder_)->HasFixedTypedArrayElements()); | |
122 if (*holder_map_ != holder_->map()) { | 121 if (*holder_map_ != holder_->map()) { |
123 holder_map_ = handle(holder_->map(), isolate_); | 122 holder_map_ = handle(holder_->map(), isolate_); |
124 } | 123 } |
125 } | 124 } |
126 | 125 |
127 | 126 |
128 void LookupIterator::PrepareForDataProperty(Handle<Object> value) { | 127 void LookupIterator::PrepareForDataProperty(Handle<Object> value) { |
129 DCHECK(state_ == DATA || state_ == ACCESSOR); | 128 DCHECK(state_ == DATA || state_ == ACCESSOR); |
130 DCHECK(HolderIsReceiverOrHiddenPrototype()); | 129 DCHECK(HolderIsReceiverOrHiddenPrototype()); |
131 | 130 |
(...skipping 22 matching lines...) Expand all Loading... |
154 ReloadPropertyInformation(); | 153 ReloadPropertyInformation(); |
155 } | 154 } |
156 | 155 |
157 | 156 |
158 void LookupIterator::ReconfigureDataProperty(Handle<Object> value, | 157 void LookupIterator::ReconfigureDataProperty(Handle<Object> value, |
159 PropertyAttributes attributes) { | 158 PropertyAttributes attributes) { |
160 DCHECK(state_ == DATA || state_ == ACCESSOR); | 159 DCHECK(state_ == DATA || state_ == ACCESSOR); |
161 DCHECK(HolderIsReceiverOrHiddenPrototype()); | 160 DCHECK(HolderIsReceiverOrHiddenPrototype()); |
162 Handle<JSObject> holder = GetHolder<JSObject>(); | 161 Handle<JSObject> holder = GetHolder<JSObject>(); |
163 if (IsElement()) { | 162 if (IsElement()) { |
164 DCHECK(!holder->HasExternalArrayElements()); | |
165 DCHECK(!holder->HasFixedTypedArrayElements()); | 163 DCHECK(!holder->HasFixedTypedArrayElements()); |
166 DCHECK(attributes != NONE || !holder->HasFastElements()); | 164 DCHECK(attributes != NONE || !holder->HasFastElements()); |
167 Handle<FixedArrayBase> elements(holder->elements()); | 165 Handle<FixedArrayBase> elements(holder->elements()); |
168 holder->GetElementsAccessor()->Reconfigure(holder, elements, number_, value, | 166 holder->GetElementsAccessor()->Reconfigure(holder, elements, number_, value, |
169 attributes); | 167 attributes); |
170 } else if (holder_map_->is_dictionary_map()) { | 168 } else if (holder_map_->is_dictionary_map()) { |
171 PropertyDetails details(attributes, v8::internal::DATA, 0, | 169 PropertyDetails details(attributes, v8::internal::DATA, 0, |
172 PropertyCellType::kMutable); | 170 PropertyCellType::kMutable); |
173 JSObject::SetNormalizedProperty(holder, name(), value, details); | 171 JSObject::SetNormalizedProperty(holder, name(), value, details); |
174 } else { | 172 } else { |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 case InterceptorState::kSkipNonMasking: | 539 case InterceptorState::kSkipNonMasking: |
542 return true; | 540 return true; |
543 case InterceptorState::kProcessNonMasking: | 541 case InterceptorState::kProcessNonMasking: |
544 return false; | 542 return false; |
545 } | 543 } |
546 } | 544 } |
547 return interceptor_state_ == InterceptorState::kProcessNonMasking; | 545 return interceptor_state_ == InterceptorState::kProcessNonMasking; |
548 } | 546 } |
549 } // namespace internal | 547 } // namespace internal |
550 } // namespace v8 | 548 } // namespace v8 |
OLD | NEW |