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

Side by Side Diff: src/objects.cc

Issue 1402973002: Move some code from Runtime_GetPrototype into a new Object::GetPrototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase. Created 5 years, 2 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/objects.h ('k') | src/objects-inl.h » ('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 "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
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
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
OLDNEW
« no previous file with comments | « src/objects.h ('k') | src/objects-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698