Commit Graph

15 Commits

Author SHA1 Message Date
Dario Rexin
abfa450e3e Merge pull request #77597 from drexin/wip-139375022
[IRGen] Set minimum runtime availability version for CVW
2024-11-14 06:11:37 -08:00
Dario Rexin
c0c31c0613 [IRGen] Set minimum runtime availability version for CVW
rdar://139375022

CVW should not be generated when the deployment target does not have the necessary runtime functions.
2024-11-13 22:36:15 -08:00
Dario Rexin
591c2cbb65 [Runtime] Add entry for native swift objc reference to initWithTakeTable in CVW runtime
rdar://139708680

The entry was missing in the function table, causing runtime crashes.
2024-11-12 15:12:19 -08:00
Dario Rexin
3301541be5 [IRGen] Fix crash in CVW generation for ObjC references
rdar://139664644

The code that differentiates between regular ObjC and native Swift ObjC references could crash when generics were involved. Instead of through the TypeInfo, we are going directly throught the SILType to the type decl, which avoids the crash caused by casting the TypeInfo.
2024-11-11 16:23:59 -08:00
Dario Rexin
3c7b556cf1 [IRGen+Runtime] Fix tag bit mask handling for objc, unknown objects and blocks
rdar://138487964

On platforms that don't have reserved bits in objc (including unknown) pointers, we use the spare bits for Swift enums, so they have to be masked out. Blocks don't have reserved bits on any platform.
2024-11-07 09:55:40 -08:00
Dario Rexin
4e7ce5a058 [IRGen+Runtime] Differentiate between pure Swift and regular ObjC references in CVW
rdar://139106139

Regular ObjC references do not have unused bits or extra inhabitants for storing enum tags, because they may be tagged pointers. However, ObjC classes that are implemented in Swift do, so we must differentiate between the two.
2024-11-04 18:52:26 -08:00
Daniel Rodríguez Troitiño
ba68faaed5 [test] Mark tests that use experimental/upcoming features as such
Find all the usages of `--enable-experimental-feature` or
`--enable-upcoming-feature` in the tests and replace some of the
`REQUIRES: asserts` to use `REQUIRES: swift-feature-Foo` instead, which
should correctly apply to depending on the asserts/noasserts mode of the
toolchain for each feature.

Remove some comments that talked about enabling asserts since they don't
apply anymore (but I might had miss some).

All this was done with an automated script, so some formatting weirdness
might happen, but I hope I fixed most of those.

There might be some tests that were `REQUIRES: asserts` that might run
in `noasserts` toolchains now. This will normally be because their
feature went from experimental to upcoming/base and the tests were not
updated.
2024-11-02 11:46:46 -07:00
Dario Rexin
daf09a5234 [Tests] Fix Interpreter/layout_string_witnesses_objc.swift
rdar://138141889

The allocation and destruction was accidentally using a wrapper, but the initialization did not, so this test could crash if the uninitialized memory contained a valid address.
2024-10-17 16:07:47 -07:00
Dario Rexin
decab5dcfc [IRGen] Don't try to emit single payload CVW for incompatible multi payload enums
rdar://137954177

There was a missing condition in the branch that caused the compiler to try to emit a single payload enum compact value witness for multi payload enums, when the multi payload enum contained an incompatible case.
2024-10-16 15:35:00 -07:00
Dario Rexin
09cd036d15 [IRGen] Fix size computation for imported C types in type layouts (#73271)
rdar://126954341

C types don't have separate size and stride, but in type layouts we always computed the size as if they did. This could cause wrong offsets in compact value witnesses
2024-04-25 19:58:14 -07:00
Nate Chandler
2d2e68aa18 [Test] Mark 3 tests unsupported on use_os_stdlib.
These tests require an OS with Swift 5.9, and that can't be expressed as
a REQUIRES: line.

rdar://114564735
2023-08-29 17:21:01 -07:00
Dario Rexin
7f1bf3bdcb Merge pull request #67673 from drexin/wip-113276992
[Test] Codesign dylib in layout_string_witnesses_objc.swift
2023-08-02 21:30:14 -07:00
Dario Rexin
da602b27fd [Test] Codesign dylib in layout_string_witnesses_objc.swift
rdar://113276992
2023-08-02 10:29:06 -07:00
Dario Rexin
fb11b50acd [Test] Fix FileCheck comments in test/Interpreter/layout_string_witnesses_objc.swift 2023-07-28 15:09:58 -07:00
Dario Rexin
f257b3bbab [Runtime] Fix _swift_refCountBytesForMetatype for reference types
_swift_addRefCountStringForMetatype and _swift_refCountBytesForMetatype diverged in the code that determines whether a type is a reference, causing the size number of ref count bytes to differ from the actually used bytes. This can cause early termination of the runtime interpreter functions, which in turn causes unbalanced reference counts.

rdar://112474091
2023-07-28 11:55:53 -07:00