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 "src/objects.h" | 5 #include "src/objects.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <iomanip> | 8 #include <iomanip> |
9 #include <sstream> | 9 #include <sstream> |
10 | 10 |
(...skipping 13868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13879 | 13879 |
13880 | 13880 |
13881 MaybeHandle<Object> JSObject::SetPrototype(Handle<JSObject> object, | 13881 MaybeHandle<Object> JSObject::SetPrototype(Handle<JSObject> object, |
13882 Handle<Object> value, | 13882 Handle<Object> value, |
13883 bool from_javascript) { | 13883 bool from_javascript) { |
13884 Isolate* isolate = object->GetIsolate(); | 13884 Isolate* isolate = object->GetIsolate(); |
13885 | 13885 |
13886 const bool observed = from_javascript && object->map()->is_observed(); | 13886 const bool observed = from_javascript && object->map()->is_observed(); |
13887 Handle<Object> old_value; | 13887 Handle<Object> old_value; |
13888 if (observed) { | 13888 if (observed) { |
13889 old_value = Object::GetPrototypeSkipHiddenPrototypes(isolate, object); | 13889 old_value = Object::GetPrototype(isolate, object); |
13890 } | 13890 } |
13891 | 13891 |
13892 Handle<Object> result; | 13892 Handle<Object> result; |
13893 ASSIGN_RETURN_ON_EXCEPTION( | 13893 ASSIGN_RETURN_ON_EXCEPTION( |
13894 isolate, result, SetPrototypeUnobserved(object, value, from_javascript), | 13894 isolate, result, SetPrototypeUnobserved(object, value, from_javascript), |
13895 Object); | 13895 Object); |
13896 | 13896 |
13897 if (observed) { | 13897 if (observed) { |
13898 Handle<Object> new_value = | 13898 Handle<Object> new_value = Object::GetPrototype(isolate, object); |
13899 Object::GetPrototypeSkipHiddenPrototypes(isolate, object); | |
13900 if (!new_value->SameValue(*old_value)) { | 13899 if (!new_value->SameValue(*old_value)) { |
13901 RETURN_ON_EXCEPTION(isolate, | 13900 RETURN_ON_EXCEPTION(isolate, |
13902 JSObject::EnqueueChangeRecord( | 13901 JSObject::EnqueueChangeRecord( |
13903 object, "setPrototype", | 13902 object, "setPrototype", |
13904 isolate->factory()->proto_string(), old_value), | 13903 isolate->factory()->proto_string(), old_value), |
13905 Object); | 13904 Object); |
13906 } | 13905 } |
13907 } | 13906 } |
13908 | 13907 |
13909 return result; | 13908 return result; |
(...skipping 3903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17813 if (cell->value() != *new_value) { | 17812 if (cell->value() != *new_value) { |
17814 cell->set_value(*new_value); | 17813 cell->set_value(*new_value); |
17815 Isolate* isolate = cell->GetIsolate(); | 17814 Isolate* isolate = cell->GetIsolate(); |
17816 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17815 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17817 isolate, DependentCode::kPropertyCellChangedGroup); | 17816 isolate, DependentCode::kPropertyCellChangedGroup); |
17818 } | 17817 } |
17819 } | 17818 } |
17820 | 17819 |
17821 } // namespace internal | 17820 } // namespace internal |
17822 } // namespace v8 | 17821 } // namespace v8 |
OLD | NEW |