Skip to content

Avoid mishandling retain_n of immortal objects where n >= 3 #30034

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

Conversation

Catfish-Man
Copy link
Contributor

@Catfish-Man Catfish-Man commented Feb 24, 2020

Fixes rdar://problem/59547400

@Catfish-Man Catfish-Man requested a review from mikeash February 24, 2020 21:51
@Catfish-Man Catfish-Man self-assigned this Feb 24, 2020
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke benchmark

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - eaa51e4ace332bb99bf7c47d82dea9fe30ca84c0

@Catfish-Man Catfish-Man force-pushed the what-i-tell-you-three-times-is-true branch from eaa51e4 to a3c450f Compare February 24, 2020 22:11
@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke benchmark

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - eaa51e4ace332bb99bf7c47d82dea9fe30ca84c0

// This exists for the benefits of the Refcounting.cpp tests. Do not use it
// elsewhere.
auto getBitsValue()
-> decltype(refCounts.load(std::memory_order_relaxed).getBitsValue()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe decltype(auto) will get you this behavior nowadays.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that you needed C++14 for return type inference on a method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm behind the times! Thanks.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - eaa51e4ace332bb99bf7c47d82dea9fe30ca84c0

@swift-ci
Copy link
Contributor

Performance: -O

Regression OLD NEW DELTA RATIO
FlattenListLoop 4181 4921 +17.7% 0.85x (?)
FlattenListFlatMap 7094 7896 +11.3% 0.90x (?)
EqualSubstringSubstring 39 42 +7.7% 0.93x (?)
LessSubstringSubstring 39 42 +7.7% 0.93x (?)
EqualSubstringSubstringGenericEquatable 39 42 +7.7% 0.93x (?)
EqualSubstringString 39 42 +7.7% 0.93x (?)
LessSubstringSubstringGenericComparable 39 42 +7.7% 0.93x
 
Improvement OLD NEW DELTA RATIO
LazilyFilteredArrayContains 36200 30200 -16.6% 1.20x
ArrayAppendLazyMap 6980 6070 -13.0% 1.15x
String.replaceSubrange.ArrChar 51 47 -7.8% 1.09x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
FlattenListFlatMap 4595 5185 +12.8% 0.89x (?)
EqualStringSubstring 40 44 +10.0% 0.91x (?)
EqualSubstringString 39 42 +7.7% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
ArrayAppendLazyMap 7900 6990 -11.5% 1.13x (?)
String.replaceSubrange.ArrChar 51 47 -7.8% 1.09x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
EqualStringSubstring 47 51 +8.5% 0.92x (?)
ArrayOfPOD 1036 1117 +7.8% 0.93x (?)
String.data.Medium 90 97 +7.8% 0.93x (?)
 
Improvement OLD NEW DELTA RATIO
StringWordBuilderReservingCapacity 2650 2470 -6.8% 1.07x (?)

Code size: -swiftlibs

How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@Catfish-Man Catfish-Man force-pushed the what-i-tell-you-three-times-is-true branch from a3c450f to d07b643 Compare February 25, 2020 00:09
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a3c450faaa35b84289abd406ee302ccecde46d73

@Catfish-Man
Copy link
Contributor Author

hm. Interesting… I wonder what I'm missing here.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a3c450faaa35b84289abd406ee302ccecde46d73

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d07b643e366b97fc4eb62f743b93a36f38cc86a8

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d07b643e366b97fc4eb62f743b93a36f38cc86a8

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 9f1968cb5b84fc0a66d559bca842d3af54d81808

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 9f1968cb5b84fc0a66d559bca842d3af54d81808

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 9f1968cb5b84fc0a66d559bca842d3af54d81808

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 9f1968cb5b84fc0a66d559bca842d3af54d81808

@Catfish-Man Catfish-Man force-pushed the what-i-tell-you-three-times-is-true branch from 87a5448 to 765af86 Compare March 19, 2020 23:47
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 87a54483a50c4adf004b77b67c35a3e1de11c20b

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 87a54483a50c4adf004b77b67c35a3e1de11c20b

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 58a0d9dd73f681534f409a83d5eb491d26da15e3

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 58a0d9dd73f681534f409a83d5eb491d26da15e3

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - eea1a3f9caf5cd36ce8f76c350455e5c07d7f52d

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - eea1a3f9caf5cd36ce8f76c350455e5c07d7f52d

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - eea1a3f9caf5cd36ce8f76c350455e5c07d7f52d

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - eea1a3f9caf5cd36ce8f76c350455e5c07d7f52d

@swift-ci
Copy link
Contributor

Build failed before running benchmark.

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@Catfish-Man
Copy link
Contributor Author

@swift-ci please benchmark

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - f4c53912ac301fa2fb2bd123318520a5315b8d3c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - f4c53912ac301fa2fb2bd123318520a5315b8d3c

@swift-ci
Copy link
Contributor

Performance: -O

Improvement OLD NEW DELTA RATIO
StringToDataEmpty 900 800 -11.1% 1.12x (?)
ObjectiveCBridgeFromNSSetAnyObjectToString 77500 71500 -7.7% 1.08x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStubFromNSDateRef 3800 4140 +8.9% 0.92x (?)
 
Improvement OLD NEW DELTA RATIO
ObjectiveCBridgeFromNSArrayAnyObjectForced 4780 4460 -6.7% 1.07x (?)

Code size: -Osize

Performance: -Onone

Improvement OLD NEW DELTA RATIO
Histogram 8541 7495 -12.2% 1.14x (?)

Code size: -swiftlibs

How to read the data The tables contain differences in performance which are larger than 8% and differences in code size which are larger than 1%.

If you see any unexpected regressions, you should consider fixing the
regressions before you merge the PR.

Noise: Sometimes the performance results (not code size!) contain false
alarms. Unexpected regressions which are marked with '(?)' are probably noise.
If you see regressions which you cannot explain you can try to run the
benchmarks again. If regressions still show up, please consult with the
performance team (@eeckstein).

Hardware Overview
  Model Name: Mac Pro
  Model Identifier: MacPro6,1
  Processor Name: 12-Core Intel Xeon E5
  Processor Speed: 2.7 GHz
  Number of Processors: 1
  Total Number of Cores: 12
  L2 Cache (per Core): 256 KB
  L3 Cache: 30 MB
  Memory: 64 GB

@Catfish-Man Catfish-Man force-pushed the what-i-tell-you-three-times-is-true branch from 184fa01 to 78c693b Compare March 25, 2020 23:18
@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke test and merge

1 similar comment
@Catfish-Man
Copy link
Contributor Author

@swift-ci please smoke test and merge

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test and merge

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 184fa016024441587d6f4aaae8bdf6e90d968337

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 184fa016024441587d6f4aaae8bdf6e90d968337

@Catfish-Man Catfish-Man merged commit 40e67b5 into swiftlang:master Mar 26, 2020
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.

4 participants