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

Side by Side Diff: src/objects.cc

Issue 1949493004: Use Null as "no accessor" in AccessorPair instead of TheHole (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « src/factory.cc ('k') | 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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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 9709 matching lines...) Expand 10 before | Expand all | Expand 10 after
9720 } 9720 }
9721 9721
9722 Handle<Object> maybe_pair(old_descriptors->GetValue(descriptor), isolate); 9722 Handle<Object> maybe_pair(old_descriptors->GetValue(descriptor), isolate);
9723 if (!maybe_pair->IsAccessorPair()) { 9723 if (!maybe_pair->IsAccessorPair()) {
9724 return Map::Normalize(map, mode, "AccessorsOverwritingNonPair"); 9724 return Map::Normalize(map, mode, "AccessorsOverwritingNonPair");
9725 } 9725 }
9726 9726
9727 Object* current = Handle<AccessorPair>::cast(maybe_pair)->get(component); 9727 Object* current = Handle<AccessorPair>::cast(maybe_pair)->get(component);
9728 if (current == *accessor) return map; 9728 if (current == *accessor) return map;
9729 9729
9730 if (!current->IsTheHole()) { 9730 if (!current->IsNull()) {
9731 return Map::Normalize(map, mode, "AccessorsOverwritingAccessors"); 9731 return Map::Normalize(map, mode, "AccessorsOverwritingAccessors");
9732 } 9732 }
9733 9733
9734 pair = AccessorPair::Copy(Handle<AccessorPair>::cast(maybe_pair)); 9734 pair = AccessorPair::Copy(Handle<AccessorPair>::cast(maybe_pair));
9735 } else if (map->NumberOfOwnDescriptors() >= kMaxNumberOfDescriptors || 9735 } else if (map->NumberOfOwnDescriptors() >= kMaxNumberOfDescriptors ||
9736 map->TooManyFastProperties(CERTAINLY_NOT_STORE_FROM_KEYED)) { 9736 map->TooManyFastProperties(CERTAINLY_NOT_STORE_FROM_KEYED)) {
9737 return Map::Normalize(map, CLEAR_INOBJECT_PROPERTIES, "TooManyAccessors"); 9737 return Map::Normalize(map, CLEAR_INOBJECT_PROPERTIES, "TooManyAccessors");
9738 } else { 9738 } else {
9739 pair = isolate->factory()->NewAccessorPair(); 9739 pair = isolate->factory()->NewAccessorPair();
9740 } 9740 }
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
10334 10334
10335 Handle<Object> AccessorPair::GetComponent(Handle<AccessorPair> accessor_pair, 10335 Handle<Object> AccessorPair::GetComponent(Handle<AccessorPair> accessor_pair,
10336 AccessorComponent component) { 10336 AccessorComponent component) {
10337 Object* accessor = accessor_pair->get(component); 10337 Object* accessor = accessor_pair->get(component);
10338 if (accessor->IsFunctionTemplateInfo()) { 10338 if (accessor->IsFunctionTemplateInfo()) {
10339 return ApiNatives::InstantiateFunction( 10339 return ApiNatives::InstantiateFunction(
10340 handle(FunctionTemplateInfo::cast(accessor))) 10340 handle(FunctionTemplateInfo::cast(accessor)))
10341 .ToHandleChecked(); 10341 .ToHandleChecked();
10342 } 10342 }
10343 Isolate* isolate = accessor_pair->GetIsolate(); 10343 Isolate* isolate = accessor_pair->GetIsolate();
10344 if (accessor->IsTheHole()) { 10344 if (accessor->IsNull()) {
10345 return isolate->factory()->undefined_value(); 10345 return isolate->factory()->undefined_value();
10346 } 10346 }
10347 return handle(accessor, isolate); 10347 return handle(accessor, isolate);
10348 } 10348 }
10349 10349
10350 Handle<DeoptimizationInputData> DeoptimizationInputData::New( 10350 Handle<DeoptimizationInputData> DeoptimizationInputData::New(
10351 Isolate* isolate, int deopt_entry_count, PretenureFlag pretenure) { 10351 Isolate* isolate, int deopt_entry_count, PretenureFlag pretenure) {
10352 return Handle<DeoptimizationInputData>::cast( 10352 return Handle<DeoptimizationInputData>::cast(
10353 isolate->factory()->NewFixedArray(LengthFor(deopt_entry_count), 10353 isolate->factory()->NewFixedArray(LengthFor(deopt_entry_count),
10354 pretenure)); 10354 pretenure));
(...skipping 8477 matching lines...) Expand 10 before | Expand all | Expand 10 after
18832 if (cell->value() != *new_value) { 18832 if (cell->value() != *new_value) {
18833 cell->set_value(*new_value); 18833 cell->set_value(*new_value);
18834 Isolate* isolate = cell->GetIsolate(); 18834 Isolate* isolate = cell->GetIsolate();
18835 cell->dependent_code()->DeoptimizeDependentCodeGroup( 18835 cell->dependent_code()->DeoptimizeDependentCodeGroup(
18836 isolate, DependentCode::kPropertyCellChangedGroup); 18836 isolate, DependentCode::kPropertyCellChangedGroup);
18837 } 18837 }
18838 } 18838 }
18839 18839
18840 } // namespace internal 18840 } // namespace internal
18841 } // namespace v8 18841 } // namespace v8
OLDNEW
« no previous file with comments | « src/factory.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698