OLD | NEW |
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 14707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
14718 | 14718 |
14719 | 14719 |
14720 template<typename Derived, typename Shape, typename Key> | 14720 template<typename Derived, typename Shape, typename Key> |
14721 Handle<Derived> HashTable<Derived, Shape, Key>::New( | 14721 Handle<Derived> HashTable<Derived, Shape, Key>::New( |
14722 Isolate* isolate, | 14722 Isolate* isolate, |
14723 int at_least_space_for, | 14723 int at_least_space_for, |
14724 MinimumCapacity capacity_option, | 14724 MinimumCapacity capacity_option, |
14725 PretenureFlag pretenure) { | 14725 PretenureFlag pretenure) { |
14726 DCHECK(0 <= at_least_space_for); | 14726 DCHECK(0 <= at_least_space_for); |
14727 DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for)); | 14727 DCHECK(!capacity_option || base::bits::IsPowerOfTwo32(at_least_space_for)); |
14728 int capacity = | 14728 |
14729 (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY) | 14729 int capacity = (capacity_option == USE_CUSTOM_MINIMUM_CAPACITY) |
14730 ? at_least_space_for | 14730 ? at_least_space_for |
14731 : isolate->serializer_enabled() && isolate->bootstrapper()->IsActive() | 14731 : isolate->creating_default_snapshot() |
14732 ? ComputeCapacityForSerialization(at_least_space_for) | 14732 ? ComputeCapacityForSerialization(at_least_space_for) |
14733 : ComputeCapacity(at_least_space_for); | 14733 : ComputeCapacity(at_least_space_for); |
14734 if (capacity > HashTable::kMaxCapacity) { | 14734 if (capacity > HashTable::kMaxCapacity) { |
14735 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true); | 14735 v8::internal::Heap::FatalProcessOutOfMemory("invalid table size", true); |
14736 } | 14736 } |
14737 | 14737 |
14738 Factory* factory = isolate->factory(); | 14738 Factory* factory = isolate->factory(); |
14739 int length = EntryToIndex(capacity); | 14739 int length = EntryToIndex(capacity); |
14740 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure); | 14740 Handle<FixedArray> array = factory->NewFixedArray(length, pretenure); |
14741 array->set_map_no_write_barrier(*factory->hash_table_map()); | 14741 array->set_map_no_write_barrier(*factory->hash_table_map()); |
14742 Handle<Derived> table = Handle<Derived>::cast(array); | 14742 Handle<Derived> table = Handle<Derived>::cast(array); |
14743 | 14743 |
(...skipping 2581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
17325 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, | 17325 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, |
17326 Handle<Object> new_value) { | 17326 Handle<Object> new_value) { |
17327 if (cell->value() != *new_value) { | 17327 if (cell->value() != *new_value) { |
17328 cell->set_value(*new_value); | 17328 cell->set_value(*new_value); |
17329 Isolate* isolate = cell->GetIsolate(); | 17329 Isolate* isolate = cell->GetIsolate(); |
17330 cell->dependent_code()->DeoptimizeDependentCodeGroup( | 17330 cell->dependent_code()->DeoptimizeDependentCodeGroup( |
17331 isolate, DependentCode::kPropertyCellChangedGroup); | 17331 isolate, DependentCode::kPropertyCellChangedGroup); |
17332 } | 17332 } |
17333 } | 17333 } |
17334 } } // namespace v8::internal | 17334 } } // namespace v8::internal |
OLD | NEW |