Commit Graph

1960 Commits

Author SHA1 Message Date
practicalswift
65b0219f7b [gardening] Fix typos 2017-02-14 20:04:08 +01:00
Simon Evans
11a71912e8 Remove misspelt CMakefile variable
- ${lowercase} was used instead of ${lowercase_sdk} so evaluated to ''
  but wasnt required anyway.
2017-02-14 17:34:13 +00:00
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
Hugh Bellamy
0ca86fb760 Merge pull request #7411 from hughbe/getKeyIntValueForDump-intrptrt
Change getKeyIntValueForDump to use intptr_t rather than long
2017-02-14 09:08:37 +07:00
practicalswift
3e40296cfa [gardening] Fix inconsistent headers 2017-02-13 15:21:52 +01:00
Hugh Bellamy
f001b7562b Use relatively new LLVM_FALLLTHROUGH instead of our own SWIFT_FALLTHROUGH 2017-02-12 10:47:03 +07:00
Hugh Bellamy
d457742a8d Change getKeyIntValueForDump to use intptr_t rather than long 2017-02-12 09:46:36 +07:00
Hugh Bellamy
a94f65cb5e Include llvm/Support/Compiler.h wherever we use __has_attribute 2017-02-12 09:30:22 +07:00
Hugh Bellamy
3a9ddbdb7a Work around Visual Studio bug inferring type of auto 2017-02-12 09:29:19 +07:00
Hugh Bellamy
16777011ab Merge pull request #7407 from hughbe/cygwin-port-conditional-compilation
Simplify CygwinPort.cpp conditional compilation
2017-02-12 09:02:22 +07:00
Greg Parker
ff2f056868 Tweak whitespace. 2017-02-11 12:51:20 -08:00
Hugh Bellamy
e9a0679493 Simplify CygwinPort.cpp conditional compilation 2017-02-11 17:31:59 +07:00
Hugh Bellamy
00b7c2ed70 Use LLVM_* attributes in the runtime 2017-02-11 17:30:01 +07:00
Erik Eckstein
254f36aba5 Revert "Use the new mangling for reflection."
This needs some changes in lldb.
Disabled for now until lldb supports the new mangling.

This reverts commit 21ba292943.
2017-02-08 09:01:51 -08:00
Erik Eckstein
6a1ff0293e stdlib: a small fix in _typeByName
The demangling tree was not correct and this did’t work with the old re-mangler.
2017-02-08 09:01:51 -08:00
Erik Eckstein
21ba292943 Use the new mangling for reflection.
For this we are linking the new re-mangler instead of the old one into the swift runtime library.
Also we are linking the new de-mangling into the swift runtime library.

It also switches to the new mangling for class names of generic swift classes in the metadata.
Note that for non-generic class we still have to use the old mangling, because the ObjC runtime in the OS depends on it (it de-mangles the class names).
But names of generic classes are not handled by the ObjC runtime anyway, so there should be no problem to change the mangling for those.
The reason for this change is that it avoids linking the old re-mangler into the runtime library.
2017-02-07 08:36:21 -08:00
Erik Eckstein
fd62be59a1 stdlib: Use the re-mangler for _typeByName
The old method of constructing a mangled class name does not work anymore with the new mangling scheme.
Also, by using the re-mangler, _typeByName now works with class names containing non-ascii characters.
2017-02-07 08:36:21 -08:00
Saleem Abdulrasool
1466a5e6e1 Merge pull request #7147 from spevans/pr_link_args
Add dependancy for Linux static-stdlib link argument files
2017-02-05 16:48:45 -08:00
Saleem Abdulrasool
b80553b9a1 build: use CMAKE_LINKER rather than hardcoding the linker
This breaks the build on exherbo, which uses target tripled linker
names.  Furthermore, the default name on unix-ish systems for the linker
is `ld`.  This can be a symlink to a specific implementation, usually
named as ld.<name> (e.g. `ld.bfd` or `ld.gold`).  Use the cmake variable
for the linker rather than hardcoding the name.
2017-02-05 13:27:15 -08:00
Hugh Bellamy
1d2aa8dcbd Cleanup uses of SWIFT_RUNTIME_EXPORT in implementation files (#7127) 2017-01-31 19:38:53 -08:00
Hugh Bellamy
d030ae4c94 Cleanup uses of SWIFT_RT_ENTRY_VISIBILITY (#7103) 2017-01-31 15:53:14 -08:00
Joe Groff
b8b7b5f53b Merge pull request #6097 from spevans/pr_solib_constructor
[runtime] Binary section data loading for extra ELF images
2017-01-30 17:13:02 -08:00
Simon Evans
86596a469e Add dependancy for Linux link argument files 2017-01-30 18:17:28 +00: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
7df2fa1b79 Merge pull request #7109 from rjmccall/global-slab-metadata-allocator
Switch MetadataCache to use a global slab allocator.
2017-01-28 17:16:51 -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
Greg Parker
ea94be6f90 [runtime] Clean up documentation of the swift_once() implementation. 2017-01-27 19:37:47 -08:00
Simon Evans
7d2a9aa761 [runtime] Abort if dlopen() fails when loading ELF section data 2017-01-27 23:50:26 +00:00
Simon Evans
5c993b45db [runtime] Remove swift_addNewDSOImage() call from static ELF binaries
- Create separate swift_begin.o/swift_end.o for lib/swift and
  lib/swift_static. The static swift_begin.o does not call
  swift_addNewDSOImage() at startup.

- Update ToolChains.cpp to use the correct swift_begin.o/swift_end.o
  files for the `-static-stdlib` and `-static-executable` options.
2017-01-27 14:04:58 +00:00
Simon Evans
30436f4077 [runtime] ELF DSO binary section fixes
- Rename swift::addNewDSOImage() to swift_addNewDSOImage() and
  export using SWIFT_RUNTIME_EXPORT.

- Move ELF specific parts of ImageInspection.h into
  ImageInspectionELF.h.
2017-01-27 14:04:54 +00:00
Simon Evans
e07c0d21c2 [runtime] Binary section data loading for extra ELF images
- For ELF targets, keep track of shared objects as they are
  dynamically loaded so that section data can be added to
  the protocol conformance and type metadata caches after
  initialisation (rdar://problem/19045112).
2017-01-27 10:28:46 +00:00
Hugh Bellamy
818099ecbe Rename swift_unreachable to swift_runtime_unreachable 2017-01-26 15:31:34 +00:00
Hugh Bellamy
5a59971b95 Move Unreachable.h from include/Basic to include/Runtime 2017-01-26 15:31:33 +00:00
Saleem Abdulrasool
ac57b66c99 Merge pull request #6820 from hughbe/extern-c
Introduce SWIFT_EXTERN_RUNTIME_EXPORT for Windows
2017-01-24 19:34:44 -08:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
Hugh Bellamy
a5a4880075 Remove extern "C" uses of SWIFT_RT_ENTRY_VISIBILITY 2017-01-22 18:32:17 +00:00
Hugh Bellamy
05a50fd978 Remove extern "C" from uses of SWIFT_RUNTIME_STDLIB_INTERFACE 2017-01-22 18:32:17 +00:00
Hugh Bellamy
63cf2d561e Remove extern "C" from uses of SWIFT_RUNTIME_EXPORT 2017-01-22 18:32:17 +00:00
practicalswift
7e48c04277 [gardening] Fix inconsistent headers. 2017-01-21 10:59:10 +01:00
practicalswift
95e47eceb7 [gardening] Fix a vs an typos. 2017-01-21 10:47:25 +01:00
Slava Pestov
230b50263e Merge pull request #6940 from hughbe/crash-client-hidden
Remove CRASH_REPORTER_CLIENT_HIDDEN in favour of equivilent LLVM macro
2017-01-20 20:28:44 -08:00
Hugh Bellamy
4e55214c18 Remove CRASH_REPORTER_CLIENT_HIDDEN in favour of equivilent LLVM macro 2017-01-20 13:48:56 +00:00
Hugh Bellamy
0b9685cbd7 Fix warnings on all platforms for cygwin specific code. 2017-01-20 12:58:47 +00:00
Joe Groff
e9efff1021 Merge pull request #6399 from spevans/pr_elf_static_binary_dladdr
[runtime] Implement lookupSymbol() for ELF static executables
2017-01-17 17:03:00 -08:00
Simon Evans
223a607639 [runtime] StaticBinaryELF review fixes
- Use llvm::Optional to avoid heap allocations and
  eliminate redundant ivars.
2017-01-17 22:45:22 +00:00
Han Sangjin
a8dec7fa43 [stdlib] Fixed for Cygwin
- CYGWIN symbol is used to distinguish Cygwin environment from other OS
  and other environment in Windows.
- Added windows and windowsCygnus to OSVersion in StdlibUnittest
2017-01-17 02:31:16 +09:00
Simon Evans
0ef3f65e34 [runtime] StaticBinaryELF safety fixes 2017-01-16 14:07:18 +00:00
Joe Groff
ecfa78a3cc Runtime: Look through artificial ObjC subclasses when building demangle trees for classes.
Fixes rdar://problem/29962114, a regression in presenting the stringified names of ObjC classes that have been dynamically subclassed by KVO.
2017-01-11 20:12:16 -08:00
Simon Evans
22b5e6d57b [runtime] Implement lookupSymbol() for ELF static executables 2017-01-09 10:56:29 +00:00
practicalswift
30a88d38e6 [gardening] Fix recently introduced typos 2017-01-06 21:16:02 +01:00