| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef VM_HASH_SET_H_ | 5 #ifndef VM_HASH_SET_H_ |
| 6 #define VM_HASH_SET_H_ | 6 #define VM_HASH_SET_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
| 10 | 10 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 ASSERT(hash != Hash(value)); | 77 ASSERT(hash != Hash(value)); |
| 78 } | 78 } |
| 79 UNREACHABLE(); | 79 UNREACHABLE(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 intptr_t Hash(uword value) const { | 83 intptr_t Hash(uword value) const { |
| 84 return value & size_mask_; | 84 return value & size_mask_; |
| 85 } | 85 } |
| 86 | 86 |
| 87 // Returns true if the given slot contains a value. | 87 // Returns true if the given slot does not contain a value. |
| 88 bool SlotIsEmpty(intptr_t index) const { | 88 bool SlotIsEmpty(intptr_t index) const { |
| 89 return keys_[index] == 0; | 89 return keys_[index] == 0; |
| 90 } | 90 } |
| 91 | 91 |
| 92 uword* keys_; | 92 uword* keys_; |
| 93 intptr_t size_mask_; | 93 intptr_t size_mask_; |
| 94 intptr_t growth_limit_; | 94 intptr_t growth_limit_; |
| 95 intptr_t count_; | 95 intptr_t count_; |
| 96 intptr_t fill_ratio_; | 96 intptr_t fill_ratio_; |
| 97 | 97 |
| 98 DISALLOW_IMPLICIT_CONSTRUCTORS(HashSet); | 98 DISALLOW_IMPLICIT_CONSTRUCTORS(HashSet); |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 } // namespace dart | 101 } // namespace dart |
| 102 | 102 |
| 103 #endif // VM_HASH_SET_H_ | 103 #endif // VM_HASH_SET_H_ |
| OLD | NEW |