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

Side by Side Diff: src/objects.cc

Issue 1095273002: Change hash table capacity heuristics when serializing. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 years, 8 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 14540 matching lines...) Expand 10 before | Expand all | Expand 10 after
14551 template<typename Derived, typename Shape, typename Key> 14551 template<typename Derived, typename Shape, typename Key>
14552 Handle<Derived> HashTable<Derived, Shape, Key>::New( 14552 Handle<Derived> HashTable<Derived, Shape, Key>::New(
14553 Isolate* isolate, 14553 Isolate* isolate,
14554 int at_least_space_for, 14554 int at_least_space_for,
14555 MinimumCapacity capacity_option, 14555 MinimumCapacity capacity_option,
14556 PretenureFlag pretenure) { 14556 PretenureFlag pretenure) {
14557 DCHECK(0 <= at_least_space_for); 14557 DCHECK(0 <= at_least_space_for);
14558 DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for)); 14558 DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for));
14559 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY) 14559 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY)
14560 ? at_least_space_for 14560 ? at_least_space_for
14561 : ComputeCapacity(at_least_space_for); 14561 : isolate->serializer_enabled()
14562 ? ComputeCapacityForSerialization(at_least_space_for)
14563 : ComputeCapacity(at_least_space_for);
14562 if (capacity > HashTable::kMaxCapacity) { 14564 if (capacity > HashTable::kMaxCapacity) {
14563 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true); 14565 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true);
14564 } 14566 }
14565 14567
14566 Factory* factory = isolate->factory(); 14568 Factory* factory = isolate->factory();
14567 int length = EntryToIndex(capacity); 14569 int length = EntryToIndex(capacity);
14568 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure); 14570 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure);
14569 array->set_map_no_write_barrier(*factory->hash_table_map()); 14571 array->set_map_no_write_barrier(*factory->hash_table_map());
14570 Handle<Derived> table = Handle<Derived>::cast(array); 14572 Handle<Derived> table = Handle<Derived>::cast(array);
14571 14573
(...skipping 2519 matching lines...) Expand 10 before | Expand all | Expand 10 after
17091 if (!invalidate && old_type == PropertyCellType::kConstant && 17093 if (!invalidate && old_type == PropertyCellType::kConstant &&
17092 new_type != PropertyCellType::kConstant) { 17094 new_type != PropertyCellType::kConstant) {
17093 auto isolate = dictionary->GetIsolate(); 17095 auto isolate = dictionary->GetIsolate();
17094 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17096 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17095 isolate, DependentCode::kPropertyCellChangedGroup); 17097 isolate, DependentCode::kPropertyCellChangedGroup);
17096 } 17098 }
17097 return value; 17099 return value;
17098 } 17100 }
17099 17101
17100 } } // namespace v8::internal 17102 } } // namespace v8::internal
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