Commit Graph

10 Commits

Author SHA1 Message Date
Mike Ash
4045edf886 [Runtime] Remove old-style mirrors in ReflectionLegacy.swift.
The old-style mirrors were the basis for non-custom, reflection based Mirrors. As part of removing old-style mirrors, reflection based Mirrors are reimplemented without them. Reflection.mm is deleted and replaced with ReflectionMirror.mm, which borrows a chunk of the old code but presents a simpler API to the Swift side. ReflectionMirror.swift then uses that API to implement a reflection-based Mirror init.

rdar://problem/20356017
2018-02-16 16:05:40 -05:00
Mike Ash
6f37cca3e0 [Runtime] Disable RuntimeFunctionCounters tests if the counters are disabled.
Also update how the variable is managed in the build system to allow the test to be conditional based on it, and make it more natural to set it on the command line.
2018-01-26 15:35:33 -05:00
Mike Ash
f48bd293cb [Runtime] Remove RuntimeFunctionCounters in no-assert builds.
A build option to include or exclude RuntimeFunctionCounters. By default, it's enabled when assertions are enabled.

rdar://problem/35864525
2018-01-25 12:18:25 -05:00
Slava Pestov
6faf99b97b stdlib: The runtime counters types don't need fixed layout 2018-01-12 00:06:03 -08:00
Max Moiseev
5650f80937 [stdlib] Annotate types with @_fixed_layout
This will allows us to build the standard library in resilient mode by
default, hopefully, without performance regression.

<rdar://problem/36362648>
2018-01-09 14:46:30 -08:00
Roman Levenstein
68d7778add Address post-commit review comments on PR #11910
- Use SWIFT_RUNTIME_EXPORT instead of SWIFT_RT_ENTRY_VISIBILITY for exposed functions
- Use `_swift_`  prefixes on the names of exposed functions
- Make the global counters and per-object counters cache thread-safe by using locks
2017-10-24 15:49:37 -07:00
Saleem Abdulrasool
5022dbc201 stdlib: fix build for LLP64 targets
When building the stdlib for Windows x86_64, we would see the following error:

  swift/stdlib/public/core/RuntimeFunctionCounters.swift:95:19: error: '(UnsafeRawPointer, Int64) -> Void' is not representable in Objective-C, so it cannot be used with '@convention(c)'
     @convention(c) (_ object: UnsafeRawPointer, _ functionId: Int64) -> Void
                    ^

This is caused by `Int64` not being mapped as on Windows x86_64, `CLong`
is mapped to `Int32` and `CLongLong` is mapped to `Int`.  This causes
the `Int64` to fail to be reverse-mapped to a C type causing the FFI
construction failure.
2017-10-10 12:21:08 -07:00
Roman Levenstein
045dc34955 Address review comments related to the Swift standard library part of the PR 2017-09-15 15:17:34 -07:00
Roman Levenstein
a4d5cad3a5 Fix creation of UnsafeRawPointer for found references 2017-09-14 19:14:03 -07:00
Roman Levenstein
a590e4902e Add experimental Swift standard library support for tracking the invocations of runtime functions
It allows for collecting the state of runtime function counters, which are used to determine how many times a given runtime function was called.

It is possible to get the global counters, which represent the total number of invocations, or per-object counters, which represent the number of runtime functions calls for a specific object.
2017-09-14 16:43:13 -07:00