| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 // Review notes: | 5 // Review notes: |
| 6 // | 6 // |
| 7 // - The use of macros in these inline functions may seem superfluous | 7 // - The use of macros in these inline functions may seem superfluous |
| 8 // but it is absolutely needed to make sure gcc generates optimal | 8 // but it is absolutely needed to make sure gcc generates optimal |
| 9 // code. gcc is not happy when attempting to inline too deep. | 9 // code. gcc is not happy when attempting to inline too deep. |
| 10 // | 10 // |
| (...skipping 3242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3253 | 3253 |
| 3254 | 3254 |
| 3255 DescriptorArray::WhitenessWitness::~WhitenessWitness() { | 3255 DescriptorArray::WhitenessWitness::~WhitenessWitness() { |
| 3256 marking_->LeaveNoMarkingScope(); | 3256 marking_->LeaveNoMarkingScope(); |
| 3257 } | 3257 } |
| 3258 | 3258 |
| 3259 | 3259 |
| 3260 int HashTableBase::ComputeCapacity(int at_least_space_for) { | 3260 int HashTableBase::ComputeCapacity(int at_least_space_for) { |
| 3261 const int kMinCapacity = 4; | 3261 const int kMinCapacity = 4; |
| 3262 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for * 2); | 3262 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for * 2); |
| 3263 if (capacity < kMinCapacity) { | 3263 return Max(capacity, kMinCapacity); |
| 3264 capacity = kMinCapacity; // Guarantee min capacity. | |
| 3265 } | |
| 3266 return capacity; | |
| 3267 } | 3264 } |
| 3268 | 3265 |
| 3269 | 3266 |
| 3270 int HashTableBase::ComputeCapacityForSerialization(int at_least_space_for) { | 3267 int HashTableBase::ComputeCapacityForSerialization(int at_least_space_for) { |
| 3271 return base::bits::RoundUpToPowerOfTwo32(at_least_space_for); | 3268 const int kMinCapacity = 1; |
| 3269 int capacity = base::bits::RoundUpToPowerOfTwo32(at_least_space_for); |
| 3270 return Max(capacity, kMinCapacity); |
| 3272 } | 3271 } |
| 3273 | 3272 |
| 3274 | 3273 |
| 3275 template <typename Derived, typename Shape, typename Key> | 3274 template <typename Derived, typename Shape, typename Key> |
| 3276 int HashTable<Derived, Shape, Key>::FindEntry(Key key) { | 3275 int HashTable<Derived, Shape, Key>::FindEntry(Key key) { |
| 3277 return FindEntry(GetIsolate(), key); | 3276 return FindEntry(GetIsolate(), key); |
| 3278 } | 3277 } |
| 3279 | 3278 |
| 3280 | 3279 |
| 3281 // Find entry for key otherwise return kNotFound. | 3280 // Find entry for key otherwise return kNotFound. |
| (...skipping 4317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7599 #undef READ_SHORT_FIELD | 7598 #undef READ_SHORT_FIELD |
| 7600 #undef WRITE_SHORT_FIELD | 7599 #undef WRITE_SHORT_FIELD |
| 7601 #undef READ_BYTE_FIELD | 7600 #undef READ_BYTE_FIELD |
| 7602 #undef WRITE_BYTE_FIELD | 7601 #undef WRITE_BYTE_FIELD |
| 7603 #undef NOBARRIER_READ_BYTE_FIELD | 7602 #undef NOBARRIER_READ_BYTE_FIELD |
| 7604 #undef NOBARRIER_WRITE_BYTE_FIELD | 7603 #undef NOBARRIER_WRITE_BYTE_FIELD |
| 7605 | 7604 |
| 7606 } } // namespace v8::internal | 7605 } } // namespace v8::internal |
| 7607 | 7606 |
| 7608 #endif // V8_OBJECTS_INL_H_ | 7607 #endif // V8_OBJECTS_INL_H_ |
| OLD | NEW |