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

Side by Side Diff: src/objects.cc

Issue 1235113002: Remove map-copying for global objects. This was an old (broken) requirement that has been fixed for… (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « 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 7254 matching lines...) Expand 10 before | Expand all | Expand 10 after
7265 7265
7266 7266
7267 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, 7267 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map,
7268 Handle<Name> name, 7268 Handle<Name> name,
7269 AccessorComponent component, 7269 AccessorComponent component,
7270 Handle<Object> accessor, 7270 Handle<Object> accessor,
7271 PropertyAttributes attributes) { 7271 PropertyAttributes attributes) {
7272 Isolate* isolate = name->GetIsolate(); 7272 Isolate* isolate = name->GetIsolate();
7273 7273
7274 // Dictionary maps can always have additional data properties. 7274 // Dictionary maps can always have additional data properties.
7275 if (map->is_dictionary_map()) { 7275 if (map->is_dictionary_map()) return map;
7276 // For global objects, property cells are inlined. We need to change the
7277 // map.
7278 if (map->IsGlobalObjectMap()) return Copy(map, "GlobalAccessor");
7279 return map;
7280 }
7281 7276
7282 // Migrate to the newest map before transitioning to the new property. 7277 // Migrate to the newest map before transitioning to the new property.
7283 map = Update(map); 7278 map = Update(map);
7284 7279
7285 PropertyNormalizationMode mode = map->is_prototype_map() 7280 PropertyNormalizationMode mode = map->is_prototype_map()
7286 ? KEEP_INOBJECT_PROPERTIES 7281 ? KEEP_INOBJECT_PROPERTIES
7287 : CLEAR_INOBJECT_PROPERTIES; 7282 : CLEAR_INOBJECT_PROPERTIES;
7288 7283
7289 Map* maybe_transition = 7284 Map* maybe_transition =
7290 TransitionArray::SearchTransition(*map, kAccessor, *name, attributes); 7285 TransitionArray::SearchTransition(*map, kAccessor, *name, attributes);
(...skipping 8829 matching lines...) Expand 10 before | Expand all | Expand 10 after
16120 Handle<Object> new_value) { 16115 Handle<Object> new_value) {
16121 if (cell->value() != *new_value) { 16116 if (cell->value() != *new_value) {
16122 cell->set_value(*new_value); 16117 cell->set_value(*new_value);
16123 Isolate* isolate = cell->GetIsolate(); 16118 Isolate* isolate = cell->GetIsolate();
16124 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16119 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16125 isolate, DependentCode::kPropertyCellChangedGroup); 16120 isolate, DependentCode::kPropertyCellChangedGroup);
16126 } 16121 }
16127 } 16122 }
16128 } // namespace internal 16123 } // namespace internal
16129 } // namespace v8 16124 } // namespace v8
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