Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Side by Side Diff: src/objects.cc

Issue 1214503009: Version 4.4.63.15 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.4
Patch Set: Rebase Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | test/mjsunit/es6/regress/regress-cr493566.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 3257 matching lines...) Expand 10 before | Expand all | Expand 10 after
3268 MaybeHandle<Object> Object::SetSuperProperty(LookupIterator* it, 3268 MaybeHandle<Object> Object::SetSuperProperty(LookupIterator* it,
3269 Handle<Object> value, 3269 Handle<Object> value,
3270 LanguageMode language_mode, 3270 LanguageMode language_mode,
3271 StoreFromKeyed store_mode) { 3271 StoreFromKeyed store_mode) {
3272 bool found = false; 3272 bool found = false;
3273 MaybeHandle<Object> result = 3273 MaybeHandle<Object> result =
3274 SetPropertyInternal(it, value, language_mode, store_mode, &found); 3274 SetPropertyInternal(it, value, language_mode, store_mode, &found);
3275 if (found) return result; 3275 if (found) return result;
3276 3276
3277 LookupIterator own_lookup(it->GetReceiver(), it->name(), LookupIterator::OWN); 3277 LookupIterator own_lookup(it->GetReceiver(), it->name(), LookupIterator::OWN);
3278 for (; own_lookup.IsFound(); own_lookup.Next()) {
3279 switch (own_lookup.state()) {
3280 case LookupIterator::ACCESS_CHECK:
3281 if (!own_lookup.HasAccess()) {
3282 return JSObject::SetPropertyWithFailedAccessCheck(&own_lookup, value,
3283 SLOPPY);
3284 }
3285 break;
3278 3286
3279 switch (own_lookup.state()) { 3287 case LookupIterator::INTEGER_INDEXED_EXOTIC:
3280 case LookupIterator::NOT_FOUND: 3288 return RedefineNonconfigurableProperty(it->isolate(), it->name(), value,
3281 return JSObject::AddDataProperty(&own_lookup, value, NONE, language_mode, 3289 language_mode);
3282 store_mode);
3283 3290
3284 case LookupIterator::INTEGER_INDEXED_EXOTIC: 3291 case LookupIterator::DATA: {
3285 return result; 3292 PropertyDetails details = own_lookup.property_details();
3286 3293 if (details.IsConfigurable() || !details.IsReadOnly()) {
3287 case LookupIterator::DATA: { 3294 return JSObject::SetOwnPropertyIgnoreAttributes(
3288 PropertyDetails details = own_lookup.property_details(); 3295 Handle<JSObject>(it->GetReceiver()), it->name(), value,
3289 if (details.IsConfigurable() || !details.IsReadOnly()) { 3296 details.attributes());
3290 return JSObject::SetOwnPropertyIgnoreAttributes( 3297 }
3291 Handle<JSObject>::cast(it->GetReceiver()), it->name(), value, 3298 return WriteToReadOnlyProperty(&own_lookup, value, language_mode);
3292 details.attributes());
3293 }
3294 return WriteToReadOnlyProperty(&own_lookup, value, language_mode);
3295 }
3296
3297 case LookupIterator::ACCESSOR: {
3298 PropertyDetails details = own_lookup.property_details();
3299 if (details.IsConfigurable()) {
3300 return JSObject::SetOwnPropertyIgnoreAttributes(
3301 Handle<JSObject>::cast(it->GetReceiver()), it->name(), value,
3302 details.attributes());
3303 } 3299 }
3304 3300
3305 return RedefineNonconfigurableProperty(it->isolate(), it->name(), value, 3301 case LookupIterator::ACCESSOR: {
3306 language_mode); 3302 PropertyDetails details = own_lookup.property_details();
3307 } 3303 if (details.IsConfigurable()) {
3304 return JSObject::SetOwnPropertyIgnoreAttributes(
3305 Handle<JSObject>(it->GetReceiver()), it->name(), value,
3306 details.attributes());
3307 }
3308 3308
3309 case LookupIterator::TRANSITION: 3309 return RedefineNonconfigurableProperty(it->isolate(), it->name(), value,
3310 UNREACHABLE(); 3310 language_mode);
3311 break; 3311 }
3312 3312
3313 case LookupIterator::INTERCEPTOR: 3313 case LookupIterator::INTERCEPTOR:
3314 case LookupIterator::JSPROXY: 3314 case LookupIterator::JSPROXY: {
3315 case LookupIterator::ACCESS_CHECK: { 3315 bool found = false;
3316 bool found = false; 3316 MaybeHandle<Object> result = SetPropertyInternal(
3317 MaybeHandle<Object> result = SetPropertyInternal( 3317 &own_lookup, value, language_mode, store_mode, &found);
3318 &own_lookup, value, language_mode, store_mode, &found); 3318 if (found) return result;
3319 if (found) return result; 3319 break;
3320 return SetDataProperty(&own_lookup, value); 3320 }
3321
3322 case LookupIterator::NOT_FOUND:
3323 case LookupIterator::TRANSITION:
3324 UNREACHABLE();
3321 } 3325 }
3322 } 3326 }
3323 3327
3324 UNREACHABLE(); 3328 return JSObject::AddDataProperty(&own_lookup, value, NONE, language_mode,
3325 return MaybeHandle<Object>(); 3329 store_mode);
3326 } 3330 }
3327 3331
3328 3332
3329 MaybeHandle<Object> Object::WriteToReadOnlyProperty( 3333 MaybeHandle<Object> Object::WriteToReadOnlyProperty(
3330 LookupIterator* it, Handle<Object> value, LanguageMode language_mode) { 3334 LookupIterator* it, Handle<Object> value, LanguageMode language_mode) {
3331 return WriteToReadOnlyProperty(it->isolate(), it->GetReceiver(), it->name(), 3335 return WriteToReadOnlyProperty(it->isolate(), it->GetReceiver(), it->name(),
3332 value, language_mode); 3336 value, language_mode);
3333 } 3337 }
3334 3338
3335 3339
(...skipping 13918 matching lines...) Expand 10 before | Expand all | Expand 10 after
17254 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17258 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17255 Handle<Object> new_value) { 17259 Handle<Object> new_value) {
17256 if (cell->value() != *new_value) { 17260 if (cell->value() != *new_value) {
17257 cell->set_value(*new_value); 17261 cell->set_value(*new_value);
17258 Isolate* isolate = cell->GetIsolate(); 17262 Isolate* isolate = cell->GetIsolate();
17259 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17263 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17260 isolate, DependentCode::kPropertyCellChangedGroup); 17264 isolate, DependentCode::kPropertyCellChangedGroup);
17261 } 17265 }
17262 } 17266 }
17263 } } // namespace v8::internal 17267 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | test/mjsunit/es6/regress/regress-cr493566.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698