OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 <iomanip> | 5 #include <iomanip> |
6 #include <sstream> | 6 #include <sstream> |
7 | 7 |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 | 9 |
10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
(...skipping 3197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3208 JSObject::GetPropertyAttributesWithInterceptor( | 3208 JSObject::GetPropertyAttributesWithInterceptor( |
3209 it->GetHolder<JSObject>(), it->GetReceiver(), it->name()); | 3209 it->GetHolder<JSObject>(), it->GetReceiver(), it->name()); |
3210 if (!maybe_attributes.IsJust()) return MaybeHandle<Object>(); | 3210 if (!maybe_attributes.IsJust()) return MaybeHandle<Object>(); |
3211 done = maybe_attributes.FromJust() != ABSENT; | 3211 done = maybe_attributes.FromJust() != ABSENT; |
3212 if (done && (maybe_attributes.FromJust() & READ_ONLY) != 0) { | 3212 if (done && (maybe_attributes.FromJust() & READ_ONLY) != 0) { |
3213 return WriteToReadOnlyProperty(it, value, language_mode); | 3213 return WriteToReadOnlyProperty(it, value, language_mode); |
3214 } | 3214 } |
3215 } | 3215 } |
3216 break; | 3216 break; |
3217 | 3217 |
3218 case LookupIterator::ACCESSOR: | 3218 case LookupIterator::ACCESSOR: { |
3219 if (it->property_details().IsReadOnly()) { | 3219 if (it->property_details().IsReadOnly()) { |
3220 return WriteToReadOnlyProperty(it, value, language_mode); | 3220 return WriteToReadOnlyProperty(it, value, language_mode); |
3221 } | 3221 } |
| 3222 Handle<Object> accessors = it->GetAccessors(); |
| 3223 if (accessors->IsAccessorInfo() && |
| 3224 !it->HolderIsReceiverOrHiddenPrototype() && |
| 3225 AccessorInfo::cast(*accessors)->is_special_data_property()) { |
| 3226 done = true; |
| 3227 break; |
| 3228 } |
3222 return SetPropertyWithAccessor(it->GetReceiver(), it->name(), value, | 3229 return SetPropertyWithAccessor(it->GetReceiver(), it->name(), value, |
3223 it->GetHolder<JSObject>(), | 3230 it->GetHolder<JSObject>(), accessors, |
3224 it->GetAccessors(), language_mode); | 3231 language_mode); |
3225 | 3232 } |
3226 case LookupIterator::INTEGER_INDEXED_EXOTIC: | 3233 case LookupIterator::INTEGER_INDEXED_EXOTIC: |
3227 done = true; | 3234 done = true; |
3228 break; | 3235 break; |
3229 | 3236 |
3230 case LookupIterator::DATA: | 3237 case LookupIterator::DATA: |
3231 if (it->property_details().IsReadOnly()) { | 3238 if (it->property_details().IsReadOnly()) { |
3232 return WriteToReadOnlyProperty(it, value, language_mode); | 3239 return WriteToReadOnlyProperty(it, value, language_mode); |
3233 } | 3240 } |
3234 if (it->HolderIsReceiverOrHiddenPrototype()) { | 3241 if (it->HolderIsReceiverOrHiddenPrototype()) { |
3235 return SetDataProperty(it, value); | 3242 return SetDataProperty(it, value); |
(...skipping 14011 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17247 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, | 17254 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
17248 Handle<Object> new_value) { | 17255 Handle<Object> new_value) { |
17249 if (cell->value() != *new_value) { | 17256 if (cell->value() != *new_value) { |
17250 cell->set_value(*new_value); | 17257 cell->set_value(*new_value); |
17251 Isolate* isolate = cell->GetIsolate(); | 17258 Isolate* isolate = cell->GetIsolate(); |
17252 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17259 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17253 isolate, DependentCode::kPropertyCellChangedGroup); | 17260 isolate, DependentCode::kPropertyCellChangedGroup); |
17254 } | 17261 } |
17255 } | 17262 } |
17256 } } // namespace v8::internal | 17263 } } // namespace v8::internal |
OLD | NEW |