Commit Graph

8969 Commits

Author SHA1 Message Date
Jordan Rose
e0ddb219d0 [stdlib] Eliminate the last direct use of Builtin.UnknownObject (#11984)
At the Swift level, this is equivalent to AnyObject, which we've done
much more testing of. This commit paves the way for taking UnknownObject
out of the SIL type system and just using it as type metadata. Filed
https://bugs.swift.org/browse/SR-5926 to track that work.
2017-09-25 13:51:22 -07:00
Lance Parker
07b9232235 Correctly handle big endian systems, updated the comment for va_arg usage 2017-09-25 12:38:18 -07:00
Tony Allevato
3618164330 [stdlib] Add _mixForSynthesizedHashValue to stdlib 2017-09-24 08:55:45 -07:00
Saleem Abdulrasool
58e89b3fff Merge pull request #11998 from compnerd/qualifiers
runtime: clean up last of -Wqual-cast warnings
2017-09-23 10:09:37 -07:00
Calvin Hill
aee81d272f Add Initial platform support for Haiku. (#11583) 2017-09-22 21:06:56 -04:00
swift-ci
b99eca9ff0 Merge pull request #12065 from compnerd/storage 2017-09-22 15:58:11 -07:00
Saleem Abdulrasool
7bd2256120 runtime: clean up last of -Wqual-cast warnings
This fixes up the remaining cast qualifier warnings from GCC 6.  Use
multiple casts to adjust the const qualification.  Prefer C++ style
casts.  NFC.
2017-09-22 14:14:13 -07:00
Saleem Abdulrasool
fec7fe17dc runtime: fix the DLL storage attribute
Ensure that the proper DLL storage is annotated on the declaration.
This currently mismatched on Windows.  On non-COFF targets, we would
just honour the visibility as specified on the definition.
2017-09-22 13:07:28 -07:00
Max Moiseev
962895b652 Merge pull request #11965 from moiseev/arkit+metal
[overlay] Add Metal, MetalKit overlays, and new APIs to ARKit
2017-09-22 11:44:18 -07:00
Lance Parker
5fe76898d5 Make Bool conform to CVarArg protocol 2017-09-22 09:51:52 -07:00
Saleem Abdulrasool
2a7e1be7b3 Merge pull request #11999 from compnerd/windows-tls-cc
stubs: fix Windows x86 TLS callback CC violation
2017-09-21 14:52:50 -07:00
Saleem Abdulrasool
42c98e63d0 stubs: fix Windows x86 TLS callback CC violation
Windows x86 requires that the TLS destructor callback uses the "stdcall"
calling convention.  Provide a shim which will adjust the calling
convention and call back into the swift portion of the code code with
the expected calling convention.
2017-09-21 11:29:56 -07:00
ktopley-apple
0dc62017a1 Merge pull request #11927 from ktopley-apple/dispatch-time-overflows
Fix overflow traps in DispatchTime/DispatchWallTime/DispatchTimeInterval
2017-09-20 13:27:35 -07:00
ktopley-apple
0165e734d1 Merge pull request #11777 from ktopley-apple/dispatch-apply-fixup
Change the fix-up for dispatch_apply() to refer to the correct replacement.
2017-09-20 12:27:39 -07:00
Kim Topley
c5af2799c1 Fix overflow traps in DispatchTime/DispatchWallTime/DispatchTimeInterval.
rdar://problem/32678302
2017-09-20 12:16:05 -07:00
Paul Menage
0766f03182 [Metadata] Unpoison memory being returned from the metadata allocator
Call __asan_unpoison_memory_region() rather than __asan_poison_memory_region()
2017-09-19 16:46:49 -07:00
Arnold Schwaighofer
c1129188f9 Merge pull request #11986 from aschwaighofer/return_dest_from_retain
runtime: return the argument from swift_retain family of functions
2017-09-19 12:38:23 -07:00
swift-ci
79a3f9c415 Merge pull request #11670 from natecook1000/nc-rev-77-2 2017-09-19 10:15:59 -07:00
Arnold Schwaighofer
bc68d51ad8 Use the preserve_most calling convention for the increment slow path
This improves x86-64 code generation to not having any stack operations on the fast path.
2017-09-19 07:16:37 -07:00
Arnold Schwaighofer
3ae6d7cb4d runtime/IRGen: return the argument from swift_retain family of functions
On architectures where the calling convention uses the same argument register as
return register this allows the argument register to be live through the calls.

We use LLVM's 'returned' attribute on the parameter to facilitate this.

We used to perform this optimization via an optimization pass. This was ripped
out some time ago around commit 955e4ed652.
By using LLVM's 'returned' attribute on swift_*retain, we get the same
optimization from the LLVM backend.
2017-09-19 07:16:37 -07:00
Saleem Abdulrasool
7ae7cc5b17 Merge pull request #11976 from compnerd/llp64
runtime: make LLP64 clean
2017-09-18 21:26:12 -07:00
Erik Eckstein
ba1a5f9cae Produce more efficient code for the init(rawValue: String) constructor of string enums, part 2.
Use a dictionary for string lookup, which is initialized the first time the constructor is called.
This is more efficient than just iterating of the string table.

Unfortunately it's still not as fast as the original version (where all the string comparisons are inlined into the constructor) for enums with < 100 strings.
But this will improve once we can pass the string and string table as borrowed parameters and we can reduce the ARC overhead.
2017-09-18 17:50:24 -07:00
Erik Eckstein
0bdd91a039 Produce more efficient code for the init(rawValue: String) constructor of string enums.
Instead of inlining a series of string comparisons, we call a library function which does the string lookup on a table of static strings.
This reduces the code size of those initializers dramatically.
Performance wise it's slower than before, because the string comparisons are not inlined anymore.
2017-09-18 17:50:24 -07:00
Roman Levenstein
937352a03b Merge pull request #11910 from swiftix/resilience-performance1
Add experimental support for tracking the invocations of runtime functions
2017-09-18 16:23:00 -07:00
Saleem Abdulrasool
8bf538cab1 Merge pull request #11947 from compnerd/windows-demangling
runtime: add undecoration support for Windows
2017-09-18 14:50:33 -07:00
Saleem Abdulrasool
b38ed2f8fc Merge pull request #11949 from compnerd/windows-tls
stdlib: generalise TLS to support Windows
2017-09-18 14:21:13 -07:00
Saleem Abdulrasool
de687ac245 Merge pull request #11960 from compnerd/stub-unicode-complexity
Stub unicode complexity
2017-09-18 13:53:50 -07:00
Roman Levenstein
acff3212b5 Add a comment explaining why the file needs to be compiled even in no-asserts builds 2017-09-18 13:18:27 -07:00
Roman Levenstein
51bb830763 #include should be on the next line after #define 2017-09-18 13:17:48 -07:00
Roman Levenstein
d8c5238449 Move FUNCTION_TO_TRACK definitions closer to the includes of "RuntimeInvocationsTracking.def" 2017-09-18 12:52:40 -07:00
Roman Levenstein
7aa8d6f2b6 Warn if FUNCTION_TO_TRACK is not defined 2017-09-18 12:51:30 -07:00
Roman Levenstein
460de35b82 Expose runtime APIs for runtime function counters in such a way that they can be used from C 2017-09-18 12:50:59 -07:00
Itai Ferber
1457e4da9d Merge pull request #11885 from cpwhidden/decoding-bool-coercion
[stdlib] Prevent coercion from Bool to numerical types when decoding JSON and plist
2017-09-18 09:15:18 -07:00
Saleem Abdulrasool
635bb00d61 runtime: make LLP64 clean
This is a blanket pass replacing use of `__LP64__` with
`__POINTER_WIDTH__ == 64`.  The latter is more expressive and also LLP64
clean.  This change is needed to enable support for Windows x86_64 which
is a LLP64 environment.
2017-09-17 18:41:10 -07:00
swift-ci
f39d4319ee Merge pull request #11974 from compnerd/const-is-your-friend 2017-09-17 18:03:27 -07:00
Saleem Abdulrasool
ef70671f77 runtime: clean up some warnings
This is a smorgasbord of warning cleanups in the runtime.  This just
adjusts the casts for the various types.  There were a number of casts
which lost const qualifiers on the type.
2017-09-17 16:20:16 -07:00
Guillaume Lessard
7b30d1ef94 add /usr/include/sysexits.h to Glibc module (#11926)
It is part of the Darwin module; this makes things more consistent.
2017-09-17 18:48:10 -04:00
Saleem Abdulrasool
13183f87b9 Merge pull request #11946 from compnerd/runtime-warnings
Runtime warnings
2017-09-17 14:58:27 -07:00
Slava Pestov
df75e536e6 Merge pull request #11969 from slavapestov/versioned-inherited-initializers
Sema: Inherited initializers inherit the @_versioned attribute
2017-09-16 17:17:48 -07:00
Philippe Hausler
c8bbce6ef1 Data slice mutation support (#11939)
* Mutations of slices of data should preserve relative indexing as well as cow semantics of slices

* Ensure hashes of ranges are uniform to the expected hash for Data

* Correct a few mistakes in the slice mutation tests

* Update sequence initializations to avoid directly calling mutableCopy which prevents slice offset mismatches

* Avoid invalid index slices in creating mirrors

* Restore the original Data description

* Resetting a slice region should expand the slice to the maximum of the region (not a out of bounds index of the backing buffer)

* Remove stray comment and use a stack buffer for sequence appending

* Return false when allocations fail in _resizeConditionalAllocationBuffer (not yet in use)

* Enumeration of regions of a slice should be limited to the slice range in the case of custom backing (e.g. dispatch_data_t)

* adjust assertion warnings for data indexes that are negative
2017-09-16 13:22:01 -07:00
Robert Widmann
74f02ad16b Merge pull request #11623 from CodaFi/fundef
[stdlib]Custom message for recursive Strideable witness
2017-09-16 11:02:09 -04:00
Slava Pestov
f3e9aa35a7 Sema: Inherited initializers inherit the @_versioned attribute
Fixes <rdar://problem/34398148>.
2017-09-16 00:23:14 -07:00
Saleem Abdulrasool
a22fc82535 runtime: clean up -Wformat warning
Add explicit casts to convert the `void *` to an integral value to
convert via printf.  NFC.
2017-09-15 17:52:37 -07:00
Saleem Abdulrasool
fb68207f0c runtime: add undecoration support for Windows
Use the Windows API `UnDecorateSymbolName` rather than `__cxa_demangle`
to undecorate the C++ symbols.  `__cxa_demangle` is only available in
the itanium ABI, not under MS ABI.  This allows us to properly
undecorate symbols on Windows.
2017-09-15 17:48:43 -07:00
swift-ci
9fc2f8ad8a Merge pull request #11959 from compnerd/stub-unicode-spacing 2017-09-15 17:45:57 -07:00
Roman Levenstein
2012451eb1 Fix a macro-definition 2017-09-15 17:31:15 -07:00
Ryan Schmitt
a4ca9d0886 [overlay] Add Metal and MetalKit overlays 2017-09-15 16:51:02 -07:00
Mike Buerli
3edd26e8e9 [overlay] Add ARFaceGeometry APIs to ARKit overlay 2017-09-15 16:51:02 -07:00
Roman Levenstein
1996d5fb64 Address review comments. 2017-09-15 16:39:08 -07:00
Saleem Abdulrasool
e1f98943ba stubs: simplify the Unicode stubs
Force the autolinking on Windows and Darwin as both have mechanisms to
support this.  ELFish targets are unfortunately not supported yet as
there is no portable mechanism to do this.

Remove the unnecessary handling of specific targets.  Always perform the
cast as it adds no overhead and will always be correct (worst case is
that the type is cast to itself).  This simplifies the logic.

Move the forward declarations to avoid inclusion to the same location as
the inclusion.
2017-09-15 15:59:27 -07:00