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

Side by Side Diff: src/objects.cc

Issue 1257873006: Revert of Remove serializer-specific hash table size heuristic. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 13328 matching lines...) Expand 10 before | Expand all | Expand 10 after
13339 Handle<Derived> HashTable<Derived, Shape, Key>::New( 13339 Handle<Derived> HashTable<Derived, Shape, Key>::New(
13340 Isolate* isolate, 13340 Isolate* isolate,
13341 int at_least_space_for, 13341 int at_least_space_for,
13342 MinimumCapacity capacity_option, 13342 MinimumCapacity capacity_option,
13343 PretenureFlag pretenure) { 13343 PretenureFlag pretenure) {
13344 DCHECK(0 <= at_least_space_for); 13344 DCHECK(0 <= at_least_space_for);
13345 DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for)); 13345 DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for));
13346 13346
13347 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY) 13347 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY)
13348 ? at_least_space_for 13348 ? at_least_space_for
13349 : ComputeCapacity(at_least_space_for); 13349 : isolate->creating_default_snapshot()
13350 ? ComputeCapacityForSerialization(at_least_space_for)
13351 : ComputeCapacity(at_least_space_for);
13350 if (capacity > HashTable::kMaxCapacity) { 13352 if (capacity > HashTable::kMaxCapacity) {
13351 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true); 13353 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true);
13352 } 13354 }
13353 13355
13354 Factory* factory = isolate->factory(); 13356 Factory* factory = isolate->factory();
13355 int length = EntryToIndex(capacity); 13357 int length = EntryToIndex(capacity);
13356 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure); 13358 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure);
13357 array->set_map_no_write_barrier(*factory->hash_table_map()); 13359 array->set_map_no_write_barrier(*factory->hash_table_map());
13358 Handle<Derived> table = Handle<Derived>::cast(array); 13360 Handle<Derived> table = Handle<Derived>::cast(array);
13359 13361
(...skipping 2410 matching lines...) Expand 10 before | Expand all | Expand 10 after
15770 if (cell->value() != *new_value) { 15772 if (cell->value() != *new_value) {
15771 cell->set_value(*new_value); 15773 cell->set_value(*new_value);
15772 Isolate* isolate = cell->GetIsolate(); 15774 Isolate* isolate = cell->GetIsolate();
15773 cell->dependent_code()->DeoptimizeDependentCodeGroup( 15775 cell->dependent_code()->DeoptimizeDependentCodeGroup(
15774 isolate, DependentCode::kPropertyCellChangedGroup); 15776 isolate, DependentCode::kPropertyCellChangedGroup);
15775 } 15777 }
15776 } 15778 }
15777 15779
15778 } // namespace internal 15780 } // namespace internal
15779 } // namespace v8 15781 } // 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