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

Side by Side Diff: src/objects.cc

Issue 958113004: Revert of Invalidate the global property cell when converting from data to accessor. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 9 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/ic/handler-compiler.h ('k') | test/mjsunit/regress/convert-global-data-to-accessor.js » ('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 <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 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 enumeration_index = original_details.dictionary_index(); 558 enumeration_index = original_details.dictionary_index();
559 DCHECK(enumeration_index > 0); 559 DCHECK(enumeration_index > 0);
560 } 560 }
561 561
562 details = PropertyDetails( 562 details = PropertyDetails(
563 details.attributes(), details.type(), enumeration_index); 563 details.attributes(), details.type(), enumeration_index);
564 564
565 if (object->IsGlobalObject()) { 565 if (object->IsGlobalObject()) {
566 Handle<PropertyCell> cell( 566 Handle<PropertyCell> cell(
567 PropertyCell::cast(property_dictionary->ValueAt(entry))); 567 PropertyCell::cast(property_dictionary->ValueAt(entry)));
568 if (details.type() != property_dictionary->DetailsAt(entry).type()) { 568 PropertyCell::SetValueInferType(cell, value);
569 Isolate* isolate = object->GetIsolate();
570 Handle<Object> hole = isolate->factory()->the_hole_value();
571 PropertyCell::SetValueInferType(cell, hole);
572 cell = isolate->factory()->NewPropertyCell(value);
573 property_dictionary->SetEntry(entry, name, cell, details);
574 } else {
575 PropertyCell::SetValueInferType(cell, value);
576 }
577 // Please note we have to update the property details. 569 // Please note we have to update the property details.
578 property_dictionary->DetailsAtPut(entry, details); 570 property_dictionary->DetailsAtPut(entry, details);
579 } else { 571 } else {
580 property_dictionary->SetEntry(entry, name, value, details); 572 property_dictionary->SetEntry(entry, name, value, details);
581 } 573 }
582 } 574 }
583 575
584 576
585 static MaybeHandle<JSObject> FindIndexedAllCanReadHolder( 577 static MaybeHandle<JSObject> FindIndexedAllCanReadHolder(
586 Isolate* isolate, Handle<JSObject> js_object, 578 Isolate* isolate, Handle<JSObject> js_object,
(...skipping 6825 matching lines...) Expand 10 before | Expand all | Expand 10 after
7412 7404
7413 7405
7414 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map, 7406 Handle<Map> Map::TransitionToAccessorProperty(Handle<Map> map,
7415 Handle<Name> name, 7407 Handle<Name> name,
7416 AccessorComponent component, 7408 AccessorComponent component,
7417 Handle<Object> accessor, 7409 Handle<Object> accessor,
7418 PropertyAttributes attributes) { 7410 PropertyAttributes attributes) {
7419 Isolate* isolate = name->GetIsolate(); 7411 Isolate* isolate = name->GetIsolate();
7420 7412
7421 // Dictionary maps can always have additional data properties. 7413 // Dictionary maps can always have additional data properties.
7422 if (map->is_dictionary_map()) return map; 7414 if (map->is_dictionary_map()) {
7415 // For global objects, property cells are inlined. We need to change the
7416 // map.
7417 if (map->IsGlobalObjectMap()) return Copy(map, "GlobalAccessor");
7418 return map;
7419 }
7423 7420
7424 // Migrate to the newest map before transitioning to the new property. 7421 // Migrate to the newest map before transitioning to the new property.
7425 map = Update(map); 7422 map = Update(map);
7426 7423
7427 PropertyNormalizationMode mode = map->is_prototype_map() 7424 PropertyNormalizationMode mode = map->is_prototype_map()
7428 ? KEEP_INOBJECT_PROPERTIES 7425 ? KEEP_INOBJECT_PROPERTIES
7429 : CLEAR_INOBJECT_PROPERTIES; 7426 : CLEAR_INOBJECT_PROPERTIES;
7430 7427
7431 int index = map->SearchTransition(kAccessor, *name, attributes); 7428 int index = map->SearchTransition(kAccessor, *name, attributes);
7432 if (index != TransitionArray::kNotFound) { 7429 if (index != TransitionArray::kNotFound) {
(...skipping 9706 matching lines...) Expand 10 before | Expand all | Expand 10 after
17139 CompilationInfo* info) { 17136 CompilationInfo* info) {
17140 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo( 17137 Handle<DependentCode> codes = DependentCode::InsertCompilationInfo(
17141 handle(cell->dependent_code(), info->isolate()), 17138 handle(cell->dependent_code(), info->isolate()),
17142 DependentCode::kPropertyCellChangedGroup, info->object_wrapper()); 17139 DependentCode::kPropertyCellChangedGroup, info->object_wrapper());
17143 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes); 17140 if (*codes != cell->dependent_code()) cell->set_dependent_code(*codes);
17144 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add( 17141 info->dependencies(DependentCode::kPropertyCellChangedGroup)->Add(
17145 cell, info->zone()); 17142 cell, info->zone());
17146 } 17143 }
17147 17144
17148 } } // namespace v8::internal 17145 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/ic/handler-compiler.h ('k') | test/mjsunit/regress/convert-global-data-to-accessor.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698