Commit Graph

67445 Commits

Author SHA1 Message Date
Karoy Lorentey 241f006ddc [test] Fix ~10% false pass rate without local hash seeds 2018-03-16 14:58:24 +00:00
Karoy Lorentey acfc1b90d4 [test] Test that hashed collections use local hash seeds 2018-03-15 16:30:44 +00:00
Karoy Lorentey 154c5598a5 Clarify rationale for using a per-capacity hash seed 2018-03-15 16:29:23 +00:00
Karoy Lorentey f783f361eb [stdlib] Set, Dictionary: Always use capacity-based seeding
Per-instance seeding would break COW, unless we stored the seed within the storage class.
2018-03-14 21:44:27 +00:00
Karoy Lorentey b08a5c2eb6 [stdlib] Set, Dictionary: Enable per-instance hash seeding
This is done by xoring the base address of the hash table storage to the hash seed.

In deterministic mode, we perturb the seed by the bucket count instead, so that we ordering within hashed collections remains repeatable (as long as the capacity doesn't change).

Fixes https://bugs.swift.org/browse/SR-3268
2018-03-14 17:54:30 +00:00
swift-ci c235eaf1ee Merge pull request #15229 from ikesyo/fix-comment 2018-03-13 22:36:31 -07:00
Rintaro Ishizaki 194a14346d [swift-syntax-test] Make VerifySyntaxTree a command line option (#15227)
Add `-verify-syntax-tree` option to `swift-syntax-test`.
Defaulted to `true`, can be disabled with `-verify-syntax-tree=false`
2018-03-14 14:05:25 +09:00
Sho Ikeda a3f9a4c408 Fix a comment in MachError.swift 2018-03-14 13:57:00 +09:00
Mark Lacey c3335e53e9 Merge pull request #15224 from rudkx/print-patterns-consistently
Change OptionalSomePattern to print in a manner consistent with other…
2018-03-13 21:38:32 -07:00
swift-ci 678ce48b26 Merge pull request #15222 from gottesmm/pr-5c8f0a2fd2ed60b2b53e8a88e01104d3c5940b21 2018-03-13 20:19:14 -07:00
Michael Gottesman b00966e247 [+0-all-args] Add more module_names to tests to enable running their plus_zero variants.
rdar://34222540
2018-03-13 19:47:50 -07:00
Michael Ilseman 1a66fd1faf Merge pull request #15219 from milseman/smol_prep
[string] Cleanup, reorganization, guts visitor
2018-03-13 18:53:48 -07:00
swift-ci 2193f52f55 Merge pull request #15214 from lorentey/accidentally-quadratic 2018-03-13 18:50:26 -07:00
Joe Groff 1e549ecdb8 Merge pull request #15217 from jckarter/irgen-silfunction-local-reference
IRGen: Set CurSourceFile for SIL functions using the module's associa…
2018-03-13 16:45:53 -07:00
Mark Lacey b4e854e9c1 Change OptionalSomePattern to print in a manner consistent with other patterns. 2018-03-13 16:40:35 -07:00
Michael Gottesman 7153472d94 Merge pull request #15180 from gottesmm/pr-479d4c83390ed6a4521744d798ac41af81ce5ce7
Revert "[cmake] Always add local swift compilation jobs to the local …
2018-03-13 16:31:08 -07:00
Michael Ilseman 4e573f47f8 [stdlib] Split StringProtocol out from String.swift; NFC 2018-03-13 15:34:35 -07:00
Michael Ilseman c3d9a22548 [test] Split CString API tests into other file; NFC 2018-03-13 15:32:20 -07:00
Michael Ilseman b572bfe2f4 [stubs] Add CFString*Bytes stubs, drop some dead ones.
NFC, just stubs and plumbing.
2018-03-13 15:32:20 -07:00
Michael Ilseman 8082ae4c0a [string] Restore StringStorage by-hand visit pattern.
StringStorage tried to adopt the visitor pattern, but it regressed
benchmarks too much. We'd like to come up with a mutation story
anyways, and StringStorage was sort of cheating that by being a class.

Restores perf-regressions of Join etc.
2018-03-13 15:32:20 -07:00
Michael Ilseman 6970238635 [gardening] code formatting; NFC 2018-03-13 15:32:20 -07:00
Michael Ilseman 189bc4dd91 [string] Un-break Linux due to duplicate def 2018-03-13 15:32:20 -07:00
Michael Ilseman 63ed19122b [string] Finally, un-version _asOpaque 2018-03-13 15:32:20 -07:00
Michael Ilseman e7c418b0fa [comments] Annotate places we don't use _StringGuts visitor. NFC
Adds some comments for sections of code that doesn't adopt the
visitation pattern, or have inefficiencies discovered as part of this
work. Additionally, mutating methods generally do not use the visitor
scheme.
2018-03-13 15:32:19 -07:00
Michael Ilseman 1229af8e0f [string] Adopt _StringGuts visitor pattern.
Use the visitor pattern in most of the opaque-by-hand call
sites. Inspecting the compiler output does not show excessive and
unanticipated ARC, but there may need to be further tweaks.

One downside of the visitor pattern as written is that there's extra
shuffling around of registers for the closure CC. Hopefully this will
also be fixed soon.
2018-03-13 15:32:19 -07:00
Michael Ilseman 9ba2f4c771 [string] Introduce the StringGuts visitor
Add a visitor-like function which will inspect the bitpattern of
_StringGuts and dispatch to the appropriate mechanism. This allows us
to keep the core usage pattern in one spot, and tweak the branching
scheme as the ABI finalizes.

It also reduces the bug surface area by allowing us to maintain
resilience in the visitor, instead of by-hand at every use site. It
also prevents expression-drift, which the by-hand opaque pattern is
susceptible to.

Current implementation is very carefully written to avoid excess
ARC. Uses need to be very careful about not capturing, or else there
will be non-trivial closure contexts and performance will blow
up. Both of these aspects will hopefully be fixed soon.
2018-03-13 15:32:19 -07:00
Michael Ilseman 12fe85fad1 [string] Establish opaque branching pattern.
Stop inlining _asOpaque into user code. Inlining it bloats user code
as there's a bit-test-and-branch to a block containing the _asOpaque
call, followed up some operations to e.g. manipulate the range or
re-align the calling convention, etc., followed by a final branch to
opaque stdlib code.

Instead, branch directly into opaque stdlib code. In theory, this
means that supporting all opaque patterns can be done with minimal
bloat. On ARM, this is a single tbnz instruction.
2018-03-13 15:32:19 -07:00
Michael Ilseman 884356fc0a [string] Bifurcate StringGuts inits for large strings.
In preparation for small strings optimizations, bifurcate StringGuts's
inits to denote when the caller is choosing to skip any checks for is
small. In the majority of cases, the caller has more local information
to guide the decision.

Adds todos and comments as well:

  * TODO(SSO) denotes any task that should be done simultaneously with
    the introduction of small strings.

  * TODO(TODO: JIRA) denotes tasks that should eventually happen
    later (and will have corresponding JIRAs filed for).

  * TODO(Comparison) denotes tasks when the new string comparison
    lands.
2018-03-13 15:32:19 -07:00
Michael Ilseman a6e79efbbe [string] Minor simplifications 2018-03-13 15:32:19 -07:00
Michael Ilseman 444796a66b [gardening] Strip trailing whitespace; NFC 2018-03-13 15:32:19 -07:00
Slava Pestov fe24602322 Merge pull request #15198 from slavapestov/unicode-scalar-iterator-fixed-layout
stdlib: Declare _UnmanagedOpaqueString.UnicodeScalarIterator fixed layout
2018-03-13 14:57:13 -07:00
swift-ci 3e74b8568b Merge pull request #15216 from apple/revert-15094-conditional-requirement-order 2018-03-13 14:51:27 -07:00
swift-ci 1bdf5e41eb Merge pull request #15215 from xedin/rdar-37790062-perf-followup 2018-03-13 14:23:26 -07:00
Joe Groff c0629d2240 IRGen: Set CurSourceFile for SIL functions using the module's associated context.
SIL functions might be associated with decls from other source files whose symbols we can't necessarily locally link to. The module should be associated with the SourceFile that was compiled.
2018-03-13 14:20:52 -07:00
Huon Wilson 0e337acae0 Revert "[AST] Ensure requirements are correctly identified as conditional." 2018-03-14 08:12:37 +11:00
Doug Gregor a191b9e14e Merge pull request #15169 from ikesyo/using-over-typedef
[gardening][lib/Basic][C++11] Replace `typedef` with `using`
2018-03-13 13:56:43 -07:00
swift-ci ec13c07117 Merge pull request #15210 from adrian-prantl/cleanup-1 2018-03-13 13:56:24 -07:00
Doug Gregor 19cdbda609 Merge pull request #15199 from DougGregor/gsb-same-type-without-potential-archetypes
[GSB] Eliminate potential archetypes from the same-type constraint representation
2018-03-13 13:54:35 -07:00
Karoy Lorentey e642a3fe08 [benchmark] Fix issues uncovered in review 2018-03-13 20:38:46 +00:00
Pavel Yaskevich 5795215928 [crashers] NFC: Limit time spent in solver for crashers 28684 and 28686 2018-03-13 13:28:58 -07:00
Slava Pestov aa4ca22b1b stdlib: Add FIXME(resilience) to @_fixed_layout declarations not added by stdlib team 2018-03-13 13:23:14 -07:00
Slava Pestov 9aae3b7b1c stdlib: Declare _UnmanagedOpaqueString.UnicodeScalarIterator fixed layout 2018-03-13 13:22:28 -07:00
Harlan a03ed4384e [Syntax] Add node definition for enums and enum cases (#15196) 2018-03-13 13:11:13 -07:00
Slava Pestov 5795bdf94a Merge pull request #15200 from slavapestov/conditional-buffer-cleanup
IRGen: Clean up FIXME in emitConditionalConformancesBuffer()
2018-03-13 13:10:24 -07:00
Karoy Lorentey b0108336f7 Merge pull request #15207 from lorentey/seedless-hashes
[runtime] Add better control over the random hashing seed
2018-03-13 19:46:51 +00:00
Karoy Lorentey c2eccf2b4d [benchmark] Add benchmarks for Dictionary operations with quadratic behavior
Dictionary and Set currently exhibit O(n^2) behavior for certain operations involving copying elements in bulk. Add benchmarks to verify an upcoming fix and to catch regressions later.

https://bugs.swift.org/browse/SR-3268
2018-03-13 19:42:45 +00:00
Pavel Yaskevich 274c1097bb Merge pull request #15187 from xedin/rdar-37790062-followup
[SILGen] NFC: Add test-cases for rdar://problem/37790062
2018-03-13 12:15:14 -07:00
Nathan Hawes 9746a284cd Merge pull request #15135 from nathawes/rdar38314383-ignore-llvm-args-for-sourcekit-ast-manager-invocation
Clear any LLVMArgs when initializing the CompilerInvocation for SourceKit's ASTManager
2018-03-13 12:07:12 -07:00
Adrian Prantl 2b1811ec90 Rename local variable (NFC) 2018-03-13 10:48:17 -07:00
swift-ci 77ae03e9c6 Merge pull request #15206 from atrick/disable-lazy-test 2018-03-13 09:56:31 -07:00