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

Side by Side Diff: src/objects.cc

Issue 1218403002: Increment descriptor array slack for prototypes by a constant rather than 50% (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: More comments 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 | « 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 <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 6766 matching lines...) Expand 10 before | Expand all | Expand 10 after
6777 6777
6778 Handle<Map> result = CopyDropDescriptors(map); 6778 Handle<Map> result = CopyDropDescriptors(map);
6779 Handle<Name> name = descriptor->GetKey(); 6779 Handle<Name> name = descriptor->GetKey();
6780 6780
6781 // Ensure there's space for the new descriptor in the shared descriptor array. 6781 // Ensure there's space for the new descriptor in the shared descriptor array.
6782 if (descriptors->NumberOfSlackDescriptors() == 0) { 6782 if (descriptors->NumberOfSlackDescriptors() == 0) {
6783 int old_size = descriptors->number_of_descriptors(); 6783 int old_size = descriptors->number_of_descriptors();
6784 if (old_size == 0) { 6784 if (old_size == 0) {
6785 descriptors = DescriptorArray::Allocate(map->GetIsolate(), 0, 1); 6785 descriptors = DescriptorArray::Allocate(map->GetIsolate(), 0, 1);
6786 } else { 6786 } else {
6787 EnsureDescriptorSlack( 6787 int slack = SlackForArraySize(map->is_prototype_map(), old_size,
6788 map, SlackForArraySize(old_size, kMaxNumberOfDescriptors)); 6788 kMaxNumberOfDescriptors);
6789 EnsureDescriptorSlack(map, slack);
6789 descriptors = handle(map->instance_descriptors()); 6790 descriptors = handle(map->instance_descriptors());
6790 } 6791 }
6791 } 6792 }
6792 6793
6793 Handle<LayoutDescriptor> layout_descriptor = 6794 Handle<LayoutDescriptor> layout_descriptor =
6794 FLAG_unbox_double_fields 6795 FLAG_unbox_double_fields
6795 ? LayoutDescriptor::ShareAppend(map, descriptor->GetDetails()) 6796 ? LayoutDescriptor::ShareAppend(map, descriptor->GetDetails())
6796 : handle(LayoutDescriptor::FastPointerLayout(), map->GetIsolate()); 6797 : handle(LayoutDescriptor::FastPointerLayout(), map->GetIsolate());
6797 6798
6798 { 6799 {
(...skipping 9349 matching lines...) Expand 10 before | Expand all | Expand 10 after
16148 Handle<Object> new_value) { 16149 Handle<Object> new_value) {
16149 if (cell->value() != *new_value) { 16150 if (cell->value() != *new_value) {
16150 cell->set_value(*new_value); 16151 cell->set_value(*new_value);
16151 Isolate* isolate = cell->GetIsolate(); 16152 Isolate* isolate = cell->GetIsolate();
16152 cell->dependent_code()->DeoptimizeDependentCodeGroup( 16153 cell->dependent_code()->DeoptimizeDependentCodeGroup(
16153 isolate, DependentCode::kPropertyCellChangedGroup); 16154 isolate, DependentCode::kPropertyCellChangedGroup);
16154 } 16155 }
16155 } 16156 }
16156 } // namespace internal 16157 } // namespace internal
16157 } // namespace v8 16158 } // 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