OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/accessors.h" | 5 #include "src/accessors.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/contexts.h" | 8 #include "src/contexts.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/execution.h" | 10 #include "src/execution.h" |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 } | 1003 } |
1004 | 1004 |
1005 | 1005 |
1006 MUST_USE_RESULT static MaybeHandle<Object> ReplaceAccessorWithDataProperty( | 1006 MUST_USE_RESULT static MaybeHandle<Object> ReplaceAccessorWithDataProperty( |
1007 Isolate* isolate, Handle<JSObject> object, Handle<Name> name, | 1007 Isolate* isolate, Handle<JSObject> object, Handle<Name> name, |
1008 Handle<Object> value, bool is_observed, Handle<Object> old_value) { | 1008 Handle<Object> value, bool is_observed, Handle<Object> old_value) { |
1009 LookupIterator it(object, name); | 1009 LookupIterator it(object, name); |
1010 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); | 1010 CHECK_EQ(LookupIterator::ACCESSOR, it.state()); |
1011 DCHECK(it.HolderIsReceiverOrHiddenPrototype()); | 1011 DCHECK(it.HolderIsReceiverOrHiddenPrototype()); |
1012 it.ReconfigureDataProperty(value, it.property_details().attributes()); | 1012 it.ReconfigureDataProperty(value, it.property_details().attributes()); |
1013 it.WriteDataValue(value); | |
1014 | 1013 |
1015 if (is_observed && !old_value->SameValue(*value)) { | 1014 if (is_observed && !old_value->SameValue(*value)) { |
1016 return JSObject::EnqueueChangeRecord(object, "update", name, old_value); | 1015 return JSObject::EnqueueChangeRecord(object, "update", name, old_value); |
1017 } | 1016 } |
1018 | 1017 |
1019 return value; | 1018 return value; |
1020 } | 1019 } |
1021 | 1020 |
1022 | 1021 |
1023 MUST_USE_RESULT static MaybeHandle<Object> SetFunctionLength( | 1022 MUST_USE_RESULT static MaybeHandle<Object> SetFunctionLength( |
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1503 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); | 1502 Handle<Object> getter = v8::FromCData(isolate, &ModuleGetExport); |
1504 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); | 1503 Handle<Object> setter = v8::FromCData(isolate, &ModuleSetExport); |
1505 info->set_getter(*getter); | 1504 info->set_getter(*getter); |
1506 if (!(attributes & ReadOnly)) info->set_setter(*setter); | 1505 if (!(attributes & ReadOnly)) info->set_setter(*setter); |
1507 return info; | 1506 return info; |
1508 } | 1507 } |
1509 | 1508 |
1510 | 1509 |
1511 } // namespace internal | 1510 } // namespace internal |
1512 } // namespace v8 | 1511 } // namespace v8 |
OLD | NEW |