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