Skip to content

[4.2] Small Strings cherry-picked into 4.2 #15553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Mar 29, 2018

Conversation

milseman
Copy link
Member

This is a cherry-pick of #14755

milseman and others added 6 commits March 27, 2018 14:40
Streamline internal String creation. Previously, everything funneled
into a single generic function, however, every single call of the
generic funnel had relevant specific information that could be used
for a more efficient algorithm.

In preparation for efficiently forming small strings, refactor this
logic into a handful of more specialized subroutines to preserve more
specific information from the callers.
This adds a small string representation capable of holding up to 15
ASCII code units directly in registers. This is extendable to UTF-8 in
the future.

It is intended to be the preferred representation whenever possible
for String, and is intended to be a String fast-path. Future small
forms may be added in the future (likely off the fast-path).

Small strings are available on 64-bit, where they are most beneficial
and well accomodated by limited address spaces. They are unavailable
on 32-bit, where they are less of a win and would require much more
hackery due to full address spaces.
Switch StringObject and StringGuts from opaquely storing tagged cocoa
strings into storing small strings. Plumb small string support
throughout the standard library's routines.
Whenever possible, prefer the small string format. Updates creation
logic. Adds assertion on large strings that they're not intended to be
small.
@milseman
Copy link
Member Author

Please test with the following PR: apple/swift-lldb#471

@swift-ci please test

@milseman
Copy link
Member Author

Please test with the following PR: apple/swift-lldb#471

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a9a0b19

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a9a0b19

@milseman
Copy link
Member Author

Please test with the following PR: apple/swift-lldb#471

@swift-ci please test

@milseman milseman requested a review from lorentey March 28, 2018 20:08
@milseman
Copy link
Member Author

@lorentey this is a cherry-pick of master

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a9a0b19

@milseman
Copy link
Member Author

Please test with the following PR: apple/swift-lldb#471

@swift-ci please test Linux Platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a9a0b19

@milseman
Copy link
Member Author

Please test with the following PR:
apple/swift-lldb#471
swiftlang/swift-corelibs-foundation#1493

@swift-ci please test Linux Platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a9a0b19

@milseman
Copy link
Member Author

Please test with the following PR:
apple/swift-lldb#471
swiftlang/swift-corelibs-foundation#1493

@swift-ci please test Linux Platform

@milseman milseman merged commit 55e03fd into swiftlang:swift-4.2-branch Mar 29, 2018
@milseman milseman deleted the 4_2_so_smol branch July 26, 2018 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants