Commit Graph

20 Commits

Author SHA1 Message Date
Michael Ilseman
020d94ade0 [string] Add less bad SPI for Foundation 2018-03-22 20:48:51 -07:00
Michael Ilseman
189bc4dd91 [string] Un-break Linux due to duplicate def 2018-03-13 15:32:20 -07:00
Michael Ilseman
63ed19122b [string] Finally, un-version _asOpaque 2018-03-13 15:32:20 -07:00
Michael Ilseman
e7c418b0fa [comments] Annotate places we don't use _StringGuts visitor. NFC
Adds some comments for sections of code that doesn't adopt the
visitation pattern, or have inefficiencies discovered as part of this
work. Additionally, mutating methods generally do not use the visitor
scheme.
2018-03-13 15:32:19 -07:00
Michael Ilseman
12fe85fad1 [string] Establish opaque branching pattern.
Stop inlining _asOpaque into user code. Inlining it bloats user code
as there's a bit-test-and-branch to a block containing the _asOpaque
call, followed up some operations to e.g. manipulate the range or
re-align the calling convention, etc., followed by a final branch to
opaque stdlib code.

Instead, branch directly into opaque stdlib code. In theory, this
means that supporting all opaque patterns can be done with minimal
bloat. On ARM, this is a single tbnz instruction.
2018-03-13 15:32:19 -07:00
Michael Ilseman
884356fc0a [string] Bifurcate StringGuts inits for large strings.
In preparation for small strings optimizations, bifurcate StringGuts's
inits to denote when the caller is choosing to skip any checks for is
small. In the majority of cases, the caller has more local information
to guide the decision.

Adds todos and comments as well:

  * TODO(SSO) denotes any task that should be done simultaneously with
    the introduction of small strings.

  * TODO(TODO: JIRA) denotes tasks that should eventually happen
    later (and will have corresponding JIRAs filed for).

  * TODO(Comparison) denotes tasks when the new string comparison
    lands.
2018-03-13 15:32:19 -07:00
Michael Ilseman
a6e79efbbe [string] Minor simplifications 2018-03-13 15:32:19 -07:00
Michael Ilseman
b1f1e98a63 [string] Clean up StringObject; Clarify its tagged BridgeObjects. (#14425)
[string] Clean up StringObject; Clarify its tagged BridgeObjects.

Bifurcate StringObjects raw bit-pattern initializers to expose whether
the caller is passing a value rather than a reference. This way,
StringObject can call the approprite BridgeObject helper and
participate in upcoming peephole optimizations like retains of
known-values. This is all meant to be a NOP.

Additionally, do some cleanup while we're at it.
2018-02-06 17:36:32 -08:00
Michael Ilseman
ccdba811f1 Merge pull request #14117 from milseman/sanitime_runty
[string] sanity check for runtime size
2018-01-23 23:06:31 -08:00
Michael Ilseman
5b716bd4bc [string] sanity check for runtime size 2018-01-23 20:24:42 -08:00
Michael Ilseman
ef926c9031 [string] Hack around more ARC.
Utilize pre-existing CFStringGetLength hack. Gives about 20%
performance improvement bridging in contiguous NSStrings from
ObjectiveC.
2018-01-22 21:29:39 -08:00
Michael Ilseman
9a87d24bc7 [string] Workaround fail emptySingleton check.
This is a temporary workaround for some situations where the empty
singleton is not being formed correctly (and this seems to be highly
configuration dependent). Work around that for now for also checking
for empty non-storage-backed Strings.

This is probably too expensive a check for us to do long-term, but it
works for now.
2018-01-22 11:07:52 -08:00
Michael Ilseman
d14b8abc8b [string] Force specialization for small Character 2018-01-22 01:06:09 -08:00
Michael Ilseman
b61b53330f [Builtin] Add _isValidAddress pointer-value check.
And adopt it for StringGuts, as it is more robust on 32-bit systems.
2018-01-21 12:40:35 -08:00
Michael Ilseman
6d1866f846 [StringGuts] Clean-up in preparation for merge.
Clean up a lot of the scattered utility functions, FIXMEs, etc in
preparation for the merge to master.
2018-01-21 12:38:49 -08:00
Karoy Lorentey
90e894729a [StringGuts] Linux support
Add support for compiling StringGuts without the Objective-C runtime.
2018-01-21 12:37:36 -08:00
Karoy Lorentey
f2a96496a0 [StringGuts] Support for 32-bit platforms
Add 32-bit support to the new StringGuts.
2018-01-21 12:36:09 -08:00
Karoy Lorentey
5cf9fd7414 Remove _StringBuffer 🎉🎉🎉 2018-01-21 12:35:15 -08:00
Karoy Lorentey
b360bd6d69 Remove _LegacyStringCore 🎉🎉🎉 2018-01-21 12:35:15 -08:00
Michael Ilseman
3be2faf5d3 [String] Initial implementation of 64-bit StringGuts.
Include the initial implementation of _StringGuts, a 2-word
replacement for _LegacyStringCore. 64-bit Darwin supported, 32-bit and
Linux support in subsequent commits.
2018-01-21 12:32:26 -08:00