Commit Graph

2520 Commits

Author SHA1 Message Date
John McCall
038303b1b1 Switch MetadataCache to use a global slab allocator.
This seems to more than fix a performance regression that we
detected on a metadata-allocation microbenchmark.

A few months ago, I improved the metadata cache representation
and changed the metadata allocation scheme to primarily use malloc.
Previously, we'd been using malloc in the concurrent tree data
structure but a per-cache slab allocator for the metadata itself.
At the time, I was concerned about the overhead of per-cache
allocators, since many metadata patterns see only a small number
of instantiations.  That's still an important factor, so in the
new scheme we're using a global allocator; but instead of using
malloc for individual allocations, we're using a slab allocator,
which should have better peak, single-thread performance, at the
cost of not easily supporting deallocation.  Deallocation is
only used for metadata when there's contention on the cache, and
specifically only when there's contention for the same key, so
leaking a little isn't the worst thing in the world.

The initial slab is a 64K globally-allocated buffer.
Successive slabs are 16K and allocated with malloc.

rdar://28189496
2017-02-14 11:10:44 -05:00
Andrew Trick
855918c620 [Lowering] Add an AddressLowering pass. 2017-02-13 17:10:02 -08:00
Mishal Shah
cd6474ca2d [Update checkout] Add support for upstream-with-swift 2017-02-13 16:44:52 -08:00
Bob Wilson
c90457fe4c Remove the old Swift 3.0 preview branch schemes. 2017-02-13 10:28:46 -08:00
Bob Wilson
e0169d5a19 Update branches for new master-next scheme.
Combine the "next" and "next-upstream" checkout schemes since the new
approach for maintaining master-next is to building against the
"upstream-with-swift" Clang/LLVM branches. We do not plan to use the
"stable-next" branches anymore. (We can delete those branches after
this transition has had time to settle out.) I have also merged the
"upstream" scheme with "next-upstream" because building the combination
of branches previously in the scheme is not something we expect to work
now.
2017-02-13 10:28:16 -08:00
Hugh Bellamy
813b8e07c3 Merge pull request #7381 from hughbe/line-directive-print
Fix line-directive print errors on different python versions
2017-02-12 09:01:59 +07:00
David Farler
76dd2a5185 Match cmark build type with swift by default
Some cmark CMake stuff changed recently and the default rules
we have in the Python build script code doesn't behave correctly
anymore, likely because it was relying on incorrect settings.

Now, by default, if the cmark build type isn't specified, it will
follow Swift's. If we don't do this, Xcode builds are broken, and
building with Xcode is important.
2017-02-10 16:47:01 -08:00
swift-ci
aedf8442cf Merge pull request #7324 from toffaletti/master 2017-02-10 11:00:41 -08:00
Hugh Bellamy
b43d63dc16 Fix line-directive print errors on different python versions 2017-02-10 14:51:48 +07:00
Jason Toffaletti
b9118b02f8 [gyb] check isinstance(result, basestring) before string comparison
Guard against types that override __eq__ and do things like
raise TypeError when the types being compared don't match.
2017-02-09 23:41:06 -08:00
Mishal Shah
517ae38246 Merge pull request #7366 from apple/update-checkout-master-next
[Update checkout] Use master branch for sub projects in master-next scheme
2017-02-09 14:59:03 -08:00
swift-ci
8023681a5f Merge pull request #7365 from apple/disable_lldb_test 2017-02-09 13:26:40 -08:00
Mishal Shah
7cb3e512c5 [Update checkout] Use master branch for sub projects in master-next scheme 2017-02-09 12:54:41 -08:00
Joe Shajrawi
df5297d877 Merge pull request #7349 from shajrawi/open_existential
Support for Open Existentials that do no take an address
2017-02-09 12:39:16 -08:00
Mishal Shah
ac2d7ff586 [Preset] Disable LLDB tests from PR testing and Swift package preset. <rdar://problem/30271691> 2017-02-09 12:23:46 -08:00
Mishal Shah
e2801652e1 Merge pull request #7362 from llvm-beanz/lldb-branch-changes
Update the checkout script configuration for LLDB changes
2017-02-09 12:01:30 -08:00
Joe Shajrawi
c478828de7 Support for Open Existentials that do no take an address 2017-02-09 11:25:34 -08:00
Hugh Bellamy
f1064e53a4 Python lint build-script 2017-02-09 18:15:08 +07:00
Hugh Bellamy
98ee1587b8 Python lint coverage-generate-data 2017-02-09 18:15:07 +07:00
Hugh Bellamy
081987fc74 Python lint coverage-query-db 2017-02-09 18:15:07 +07:00
Hugh Bellamy
ccb7882ba0 Python lint line-directive 2017-02-09 18:15:07 +07:00
Hugh Bellamy
a977b8cc5f Python lint scale-test 2017-02-09 18:15:06 +07:00
Hugh Bellamy
36f07499df Python lint update-checkout 2017-02-09 18:15:06 +07:00
Doug Coleman
480e0d785b build-script: Allowing passing of libtool path to llvm. 2017-02-08 19:42:10 -07:00
Chris Bieneman
f6d622aa1b Update the checkout script configuration for LLDB changes
This change updates the branch mappings for the Swift-LLDB repository to match the LLVM & Clang model which LLDB is adopting.
2017-02-08 13:05:24 -08:00
Colin Douglas Howell
fecbd22cb4 utils/update-checkout: Rework for more parallelism in updates
Reworks the update_all_repositories() and update_single_repository()
functions to benefit from more per-repo parallelism.

* Branch-scheme search loop is relocated from update_repository_to_scheme()
  to update_all_repositories().
* Functions update_repository_to_tag() and update_repository_to_scheme()
  are removed.
* Per-repo work of these functions is shifted to update_single_repository().
* Repeated work (repeated pushd's, etc.) has been eliminated.
* As much work as possible is performed within update_single_repository()'s
  outer try clause to catch more errors.
* Arguments passed to update_single_repository() have been changed
  appropriately.
* New helper functions confirm_tag_in_repo() and get_branch_for_repo() added
  to keep update_single_repository()'s length under control.
* Unnecessary setting of the cross_repo flag by the --tag argument has been
  removed, so repos which lack the tag are now properly rebased when updated.
2017-02-07 16:05:32 -08:00
Colin Douglas Howell
03125798f8 utils/update-checkout: Fix for mishandling detached HEAD in SR-3854 (#7232)
* utils/update-checkout: Fix for mishandling detached HEAD in SR-3854

In update_single_repository, before doing the rebase step, check whether
the current HEAD is a "detached HEAD", normally the result of checking
out a tag by previously invoking update-checkout with the --tag option.
If HEAD is a detached HEAD, skip the rebase (and print an explanatory
message), because rebasing would do the wrong thing and make a mess.

* utils/update-checkout: more robust error handling for SR-3854 fix

We now examine the exception raised by the "git symbolic-ref -q HEAD"
command to check whether the exception was indeed due to a detached HEAD.
If there was an actual error in the command, we re-raise the exception
so that it can be handled like errors from other commands.
2017-02-07 09:53:04 -08:00
Doug Coleman
9d0d533723 cmake/build-script: Allow passing a lipo path instead of finding it from
Xcode.
2017-02-07 03:31:09 -07:00
Michael Gottesman
554feff463 [semantic-sil] Create unmanaged_autorelease_value.
This is an autorelease for use with Builtin.autorelease that does not need to be
balanced as part of the ownership model.

rdar://29791263
2017-02-06 12:11:46 -08:00
Michael Gottesman
fee2db81de [cmake] Add a new option called SWIFT_FORCE_OPTIMIZED_TYPECHECKER that forces Sema to be built optimized.
This should help speed up people trying to compile the standard library and do
SILGen work. *NOTE* This will not necessarily result in a type checker that is
as fast as a release build since most likely the type checker will use some
link_once odr functions that are debug. But it should still be significantly
faster otherwise.

This makes getting to SILGen take 16 seconds on my machine instead of forever
when compiling with everything else in the compiler in debug mode.
2017-02-05 16:48:54 -08:00
Doug Coleman
309312d81c utils/update-checkout: Handle missing repository/tag combinations.
Fixes https://bugs.swift.org/browse/SR-3810
2017-02-01 13:01:04 -08:00
Doug Coleman
07ddf07f3b utils/update-checkout: Do any `git checkout before the git fetch`.
utils/update-checkout: Add a call to ``git rebase --abort`` when using the ``--clean`` option.
Calling ``git fetch`` updates .git/FETCH_HEAD and marks all branches
besides the currently checked out branch as not-for-merge. So tot
ensure that the branch we want to merge is available for merging, we
must do a checkout of that branch before updating the FETCH_HEAD file.

We also must ensure that we have fetched before optionally resetting to remote.

Fixes https://bugs.swift.org/browse/SR-3800.

The --clean option is meant to restore your repository to a pristine
condition, but there are cases where you can ``reset --hard`` and still be
in the middle of a rebase. This is annoying across 10+ repositories, so
if the user wants to --clean, then abort all rebases in progress.
2017-01-31 12:48:09 -08:00
John McCall
2b25701a93 Revert "Switch MetadataCache to use a global slab allocator."
This reverts commit ccbe5fcf73.
2017-01-29 00:17:30 -05:00
John McCall
ccbe5fcf73 Switch MetadataCache to use a global slab allocator.
This seems to more than fix a performance regression that we
detected on a metadata-allocation microbenchmark.

A few months ago, I improved the metadata cache representation
and changed the metadata allocation scheme to primarily use malloc.
Previously, we'd been using malloc in the concurrent tree data
structure but a per-cache slab allocator for the metadata itself.
At the time, I was concerned about the overhead of per-cache
allocators, since many metadata patterns see only a small number
of instantiations.  That's still an important factor, so in the
new scheme we're using a global allocator; but instead of using
malloc for individual allocations, we're using a slab allocator,
which should have better peak, single-thread performance, at the
cost of not easily supporting deallocation.  Deallocation is
only used for metadata when there's contention on the cache, and
specifically only when there's contention for the same key, so
leaking a little isn't the worst thing in the world.

The initial slab is a 64K globally-allocated buffer.
Successive slabs are 16K and allocated with malloc.

rdar://28189496
2017-01-28 02:37:22 -05:00
Hugh Bellamy
3b4187fcbb Fix line-directive tool to work around Windows command line max limit 2017-01-26 09:34:55 +00:00
Mishal Shah
390cd0543d [update-checkout] Add support for swift-4.0-branch 2017-01-25 21:47:34 -08:00
Michael Gottesman
9202a80442 [sil-mode] Add highlighting for dealloc_existential_box. 2017-01-25 18:03:05 -08:00
Mishal Shah
92ef777085 Update master to build with Xcode 8.3 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2017-01-25 16:13:36 -08:00
Doug Coleman
091af4cd10 Merge pull request #7001 from natecook1000/nc-clean-delay
Add a short delay before cleaning a build directory
2017-01-24 19:07:40 -08:00
Nate Cook
02441e4e69 Add a short delay before cleaning a build
Adds a three second delay when the `-c` or `--clean` options are
given to utils/build-script, providing a chance to cancel the build
before the existing build folder is removed.
2017-01-24 13:05:40 -06:00
swift-ci
ef7ad57bed Merge pull request #6977 from practicalswift/pep8-gardening-ii 2017-01-23 06:25:22 -08:00
Michael Gottesman
d045f20867 [semantic-sil] Add a new instruction end_borrow_argument.
I need this instruction in order to model the end of life of a guaranteed phi
arguments.

rdar://29791263
2017-01-22 20:46:25 -08:00
practicalswift
92ccc44b3a [gardening] Fix recently introduced PEP-8 deviations 2017-01-22 22:02:33 +01:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
practicalswift
7aa8f9e3f4 [gardening] PEP-8 cleanups. 2017-01-21 11:01:40 +01:00
swift-ci
da8f4151e6 Merge pull request #6781 from gmilos/master 2017-01-20 12:20:24 -08:00
Andy Bargh
631495ce30 Fix 'eixsts' typo 2017-01-20 14:45:22 +00:00
Slava Pestov
7b5cf4ab7d Merge pull request #3841 from tinysun212/pr-swiftc-cygwin-2
[swiftc] Fixed for Cygwin
2017-01-19 20:17:47 -08:00
swift-ci
0e8dc4443d Merge pull request #6916 from gottesmm/unmanaged_retainrelease_value 2017-01-19 14:05:08 -08:00
Mishal Shah
a2d161b46e Merge pull request #6895 from zisko/master
Make build script swift version default to 3.1
2017-01-19 13:47:00 -08:00