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

Side by Side Diff: src/objects.cc

Issue 1105063003: Only try to unregister prototype users that are prototypes themselves (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | 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 1900 matching lines...) Expand 10 before | Expand all | Expand 10 after
1911 // prototype chains involving it. 1911 // prototype chains involving it.
1912 InvalidatePrototypeChains(object->map()); 1912 InvalidatePrototypeChains(object->map());
1913 Handle<Map> old_map(object->map()); 1913 Handle<Map> old_map(object->map());
1914 1914
1915 // If the map was registered with its prototype before, ensure that it 1915 // If the map was registered with its prototype before, ensure that it
1916 // registers with its new prototype now. This preserves the invariant that 1916 // registers with its new prototype now. This preserves the invariant that
1917 // when a map on a prototype chain is registered with its prototype, then 1917 // when a map on a prototype chain is registered with its prototype, then
1918 // all prototypes further up the chain are also registered with their 1918 // all prototypes further up the chain are also registered with their
1919 // respective prototypes. 1919 // respective prototypes.
1920 Object* maybe_old_prototype = old_map->prototype(); 1920 Object* maybe_old_prototype = old_map->prototype();
1921 if (maybe_old_prototype->IsJSObject()) { 1921 if (FLAG_track_prototype_users && old_map->is_prototype_map() &&
1922 maybe_old_prototype->IsJSObject()) {
1922 Handle<JSObject> old_prototype(JSObject::cast(maybe_old_prototype)); 1923 Handle<JSObject> old_prototype(JSObject::cast(maybe_old_prototype));
1923 bool was_registered = 1924 bool was_registered =
1924 JSObject::UnregisterPrototypeUser(old_prototype, old_map); 1925 JSObject::UnregisterPrototypeUser(old_prototype, old_map);
1925 if (was_registered) { 1926 if (was_registered) {
1926 JSObject::LazyRegisterPrototypeUser(new_map, new_map->GetIsolate()); 1927 JSObject::LazyRegisterPrototypeUser(new_map, new_map->GetIsolate());
1927 } 1928 }
1928 } 1929 }
1929 1930
1930 if (object->HasFastProperties()) { 1931 if (object->HasFastProperties()) {
1931 if (!new_map->is_dictionary_map()) { 1932 if (!new_map->is_dictionary_map()) {
(...skipping 15269 matching lines...) Expand 10 before | Expand all | Expand 10 after
17201 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17202 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17202 Handle<Object> new_value) { 17203 Handle<Object> new_value) {
17203 if (cell->value() != *new_value) { 17204 if (cell->value() != *new_value) {
17204 cell->set_value(*new_value); 17205 cell->set_value(*new_value);
17205 Isolate* isolate = cell->GetIsolate(); 17206 Isolate* isolate = cell->GetIsolate();
17206 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17207 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17207 isolate, DependentCode::kPropertyCellChangedGroup); 17208 isolate, DependentCode::kPropertyCellChangedGroup);
17208 } 17209 }
17209 } 17210 }
17210 } } // namespace v8::internal 17211 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698