OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 2006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2017 | 2017 |
2018 | 2018 |
2019 DescriptorArray::WhitenessWitness::~WhitenessWitness() { | 2019 DescriptorArray::WhitenessWitness::~WhitenessWitness() { |
2020 marking_->LeaveNoMarkingScope(); | 2020 marking_->LeaveNoMarkingScope(); |
2021 } | 2021 } |
2022 | 2022 |
2023 | 2023 |
2024 template<typename Shape, typename Key> | 2024 template<typename Shape, typename Key> |
2025 int HashTable<Shape, Key>::ComputeCapacity(int at_least_space_for) { | 2025 int HashTable<Shape, Key>::ComputeCapacity(int at_least_space_for) { |
2026 const int kMinCapacity = 32; | 2026 const int kMinCapacity = 32; |
2027 int capacity = RoundUpToPowerOf2(at_least_space_for * 2); | 2027 int capacity = SignedRoundUpToPowerOf2(at_least_space_for * 2); |
2028 if (capacity < kMinCapacity) { | 2028 if (capacity < kMinCapacity) { |
2029 capacity = kMinCapacity; // Guarantee min capacity. | 2029 capacity = kMinCapacity; // Guarantee min capacity. |
2030 } | 2030 } |
2031 return capacity; | 2031 return capacity; |
2032 } | 2032 } |
2033 | 2033 |
2034 | 2034 |
2035 template<typename Shape, typename Key> | 2035 template<typename Shape, typename Key> |
2036 int HashTable<Shape, Key>::FindEntry(Key key) { | 2036 int HashTable<Shape, Key>::FindEntry(Key key) { |
2037 return FindEntry(GetIsolate(), key); | 2037 return FindEntry(GetIsolate(), key); |
(...skipping 2713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4751 #undef WRITE_INT_FIELD | 4751 #undef WRITE_INT_FIELD |
4752 #undef READ_SHORT_FIELD | 4752 #undef READ_SHORT_FIELD |
4753 #undef WRITE_SHORT_FIELD | 4753 #undef WRITE_SHORT_FIELD |
4754 #undef READ_BYTE_FIELD | 4754 #undef READ_BYTE_FIELD |
4755 #undef WRITE_BYTE_FIELD | 4755 #undef WRITE_BYTE_FIELD |
4756 | 4756 |
4757 | 4757 |
4758 } } // namespace v8::internal | 4758 } } // namespace v8::internal |
4759 | 4759 |
4760 #endif // V8_OBJECTS_INL_H_ | 4760 #endif // V8_OBJECTS_INL_H_ |
OLD | NEW |