Skip to content

[stdlib] Set, Dictionary: Hash table unification, general cleanup before ABI stability #19213

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 33 commits into from
Sep 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1848b37
[stdlib] Add bitset constructs
lorentey Sep 13, 2018
376753e
[stdlib] Hasher._Seed: Add internal typealias
lorentey Sep 13, 2018
b95ba25
[stdlib] Add _HashTable implementing low-level hash table operations
lorentey Sep 13, 2018
edb8a73
[stdlib] Set, Dictionary: New storage classes for the empty singletons
lorentey Sep 13, 2018
19a6ca9
[stdlib] Remove _UnsafeBitMap
lorentey Sep 13, 2018
546c829
[stdlib] _makeCollectionDescription: Make internal
lorentey Sep 13, 2018
18ad793
[stdlib] _stdlib_NSObject_isEqual: Make internal
lorentey Sep 13, 2018
86f64f5
[stdlib] GroupInfo.json: Make a Hashing group
lorentey Sep 13, 2018
098275f
[stdlib] Clean up Set and Dictionary
lorentey Sep 19, 2018
95d9fba
[test] Update tests for Set/Dictionary changes
lorentey Sep 19, 2018
3080512
[stdlib] Dictionary: Describe mutatingFind(_:)
lorentey Sep 19, 2018
39d0ef1
[stdlib] Dictionary: prepareForMutation(at:) ⟹ ensureUniqueNative(pre…
lorentey Sep 19, 2018
b4ab5a0
[stdlib] Dictionary: Don’t use the allKeys property of bridged indice…
lorentey Sep 19, 2018
7e5c651
[stdlib] Dictionary: Attempt to work around ClosureSpecializer crash
lorentey Sep 19, 2018
ea6ffd3
[stdlib] Dictionary: Fix compilation on non-ObjC platforms
lorentey Sep 19, 2018
c3540de
[stdlib] Fix performance regression in Dictionary.Keys.contains(_:)
lorentey Sep 20, 2018
c19e20b
[stdlib] Set, Dictionary: Make _HashTableDelegate implementations inl…
lorentey Sep 20, 2018
8366edd
[stdlib] Set, Dictionary: Simplify variant processing
lorentey Sep 20, 2018
4421d1e
[stdlib] Dictionary: Speed up Keys.subscript for bridged dictionaries
lorentey Sep 20, 2018
778defa
[stdlib] Set, Dictionary: Speed up insert/remove when there’s nothing…
lorentey Sep 20, 2018
2094581
[stdlib] Add missing calls to cocoaPath()
lorentey Sep 20, 2018
4e64931
[stdlib] Set.Iterator.next(): Work around compiler crash in non-ObjC …
lorentey Sep 21, 2018
9b7ba7d
[stdlib] Temporary workaround for issue fixed in #19444
lorentey Sep 21, 2018
e41a6f9
[stdlib] Dictionary.removeValue(forKey:): Fix typo.
lorentey Sep 21, 2018
a84ece7
[stdlib] Bitset: Eliminate a trap that wasn’t optimized away
lorentey Sep 21, 2018
00bbf1b
[test] Fix flaky test
lorentey Sep 21, 2018
3c8ac88
[stdlib] Remove _Bitset type for now
lorentey Sep 21, 2018
77dbc5b
[test] Remove _Bitset tests
lorentey Sep 21, 2018
ace19fd
[runtime] Fix layout of empty Set/Dictionary singletons
lorentey Sep 21, 2018
b2d4e80
[stdlib] Discourage CoW copying / rehashing from getting inlined
lorentey Sep 22, 2018
430a9f3
[stdlib] _BridgingHashBuffer: Fix memory management
lorentey Sep 22, 2018
ff882f4
[stdlib] Set, Dictionary: Sanitize @objc-ness for NSEnumerator members
lorentey Sep 22, 2018
9ae572f
[stdlib] Dictionary: Remove workaround for rdar://problem/44612356
lorentey Sep 22, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 19 additions & 20 deletions stdlib/public/SwiftShims/GlobalObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,43 +40,42 @@ struct _SwiftEmptyArrayStorage {
SWIFT_RUNTIME_STDLIB_API
struct _SwiftEmptyArrayStorage _swiftEmptyArrayStorage;

struct _SwiftUnsafeBitMap {
__swift_uintptr_t *values;
__swift_intptr_t bitCount;
};

struct _SwiftDictionaryBodyStorage {
__swift_intptr_t capacity;
__swift_intptr_t count;
struct _SwiftUnsafeBitMap initializedEntries;
void *keys;
void *values;
__swift_intptr_t capacity;
__swift_intptr_t scale;
__swift_uint64_t seed0;
__swift_uint64_t seed1;
void *rawKeys;
void *rawValues;
};

struct _SwiftSetBodyStorage {
__swift_intptr_t capacity;
__swift_intptr_t count;
struct _SwiftUnsafeBitMap initializedEntries;
void *keys;
__swift_intptr_t capacity;
__swift_intptr_t scale;
__swift_uint64_t seed0;
__swift_uint64_t seed1;
void *rawElements;
};

struct _SwiftEmptyDictionaryStorage {
struct _SwiftEmptyDictionarySingleton {
struct HeapObject header;
struct _SwiftDictionaryBodyStorage body;
__swift_uintptr_t entries;
__swift_uintptr_t metadata;
};

struct _SwiftEmptySetStorage {
struct _SwiftEmptySetSingleton {
struct HeapObject header;
struct _SwiftSetBodyStorage body;
__swift_uintptr_t entries;
__swift_uintptr_t metadata;
};

SWIFT_RUNTIME_STDLIB_API
struct _SwiftEmptyDictionaryStorage _swiftEmptyDictionaryStorage;
struct _SwiftEmptyDictionarySingleton _swiftEmptyDictionarySingleton;

SWIFT_RUNTIME_STDLIB_API
struct _SwiftEmptySetStorage _swiftEmptySetStorage;
struct _SwiftEmptySetSingleton _swiftEmptySetSingleton;

struct _SwiftHashingParameters {
__swift_uint64_t seed0;
Expand All @@ -91,9 +90,9 @@ struct _SwiftHashingParameters _swift_stdlib_Hashing_parameters;

static_assert(std::is_pod<_SwiftEmptyArrayStorage>::value,
"empty array type should be POD");
static_assert(std::is_pod<_SwiftEmptyDictionaryStorage>::value,
static_assert(std::is_pod<_SwiftEmptyDictionarySingleton>::value,
"empty dictionary type should be POD");
static_assert(std::is_pod<_SwiftEmptySetStorage>::value,
static_assert(std::is_pod<_SwiftEmptySetSingleton>::value,
"empty set type should be POD");

}} // extern "C", namespace swift
Expand Down
1 change: 0 additions & 1 deletion stdlib/public/core/ArrayShared.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ func _deallocateUninitializedArray<Element>(
// Utility method for collections that wish to implement CustomStringConvertible
// and CustomDebugStringConvertible using a bracketed list of elements,
// like an array.
@inlinable // FIXME(sil-serialize-all)
internal func _makeCollectionDescription<C: Collection>
(for items: C, withTypeName type: String?) -> String {
var result = ""
Expand Down
Loading