Skip to content

Update fast dealloc to use new-style interposing and support objc weak refs #25864

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

Conversation

Catfish-Man
Copy link
Contributor

@Catfish-Man Catfish-Man commented Jun 28, 2019

Fixes rdar://problem/36825362

@Catfish-Man Catfish-Man requested a review from mikeash June 28, 2019 21:17
@Catfish-Man Catfish-Man self-assigned this Jun 28, 2019
@Catfish-Man Catfish-Man force-pushed the no-objc-complications-once-more-into-the-breach branch from dcb5b70 to 1ddba98 Compare June 29, 2019 00:42
@Catfish-Man Catfish-Man marked this pull request as ready for review June 29, 2019 00:43
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1ddba98f56fb87a2d4f2513a9babd11a57cddf22

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1ddba98f56fb87a2d4f2513a9babd11a57cddf22

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1ddba98f56fb87a2d4f2513a9babd11a57cddf22

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1ddba98f56fb87a2d4f2513a9babd11a57cddf22

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1ddba98f56fb87a2d4f2513a9babd11a57cddf22

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 38b2d2415f233d7fbd007f5025fc56c3c0c34eae

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 38b2d2415f233d7fbd007f5025fc56c3c0c34eae

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - a09b667475689f15562d3599720a91100467606c

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - a09b667475689f15562d3599720a91100467606c

@Catfish-Man
Copy link
Contributor Author

Ok, looks like we're still at "weak interop fails on i386 simulator only", which is interesting

@Catfish-Man Catfish-Man force-pushed the no-objc-complications-once-more-into-the-breach branch from bb516a0 to 24a08b4 Compare January 9, 2020 23:20
@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

Performance: -O

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 60 69 +15.0% 0.87x
StringUTF16Builder 300 330 +10.0% 0.91x (?)
FloatingPointPrinting_Float_description_small 4968 5400 +8.7% 0.92x
 
Improvement OLD NEW DELTA RATIO
ObjectAllocation 140 101 -27.9% 1.39x
DictionarySwapAtOfObjects 6424 5027 -21.7% 1.28x
DictionarySubscriptDefaultMutationOfObjects 1380 1080 -21.7% 1.28x
ArrayPlusEqualThreeElements 1590 1250 -21.4% 1.27x
StackPromo 14500 11600 -20.0% 1.25x
COWArrayGuaranteedParameterOverhead 3250 2600 -20.0% 1.25x
DictionaryBridgeToObjC_Bridge 16 13 -18.7% 1.23x (?)
MapReduceShortString 16 13 -18.7% 1.23x
StringBuilderLong 1140 930 -18.4% 1.23x (?)
DictionaryGroupOfObjects 1530 1269 -17.1% 1.21x
DictionarySwapOfObjects 7080 5880 -16.9% 1.20x
DictionarySubscriptDefaultMutationArrayOfObjects 3340 2780 -16.8% 1.20x
MapReduceShort 2100 1750 -16.7% 1.20x
MapReduceClassShort2 180 150 -16.7% 1.20x
MapReduceAnyCollectionShort 1810 1510 -16.6% 1.20x
DictionaryRemoveOfObjects 19600 16400 -16.3% 1.20x
DictionaryOfObjects 1990 1675 -15.8% 1.19x (?)
ArrayOfRef 3710 3130 -15.6% 1.19x
FloatingPointPrinting_Double_description_small 18700 15800 -15.5% 1.18x
SuffixAnyCollection 13 11 -15.4% 1.18x
DropLastAnyCollection 13 11 -15.4% 1.18x (?)
ArrayOfGenericRef 3730 3160 -15.3% 1.18x
DataCreateMedium 2700 2300 -14.8% 1.17x (?)
SortLettersInPlace 491 419 -14.7% 1.17x
CharacterPropertiesFetch 3450 2950 -14.5% 1.17x (?)
RangeReplaceableCollectionPlusDefault 732 628 -14.2% 1.17x (?)
FloatingPointPrinting_Double_description_uniform 20400 17600 -13.7% 1.16x
CStringShortAscii 1470 1270 -13.6% 1.16x
DictionaryLiteral 1840 1590 -13.6% 1.16x (?)
CSVParsing.Scalar 193 167 -13.5% 1.16x (?)
AngryPhonebook.Strasse.Small 883 769 -12.9% 1.15x (?)
MapReduceNSDecimalNumberShort 246 215 -12.6% 1.14x (?)
Combos 425 372 -12.5% 1.14x (?)
FilterEvenUsingReduce 970 850 -12.4% 1.14x
AngryPhonebook.Cyrillic.Small 762 668 -12.3% 1.14x (?)
DataToStringLargeUnicode 5700 5000 -12.3% 1.14x (?)
DataMutateBytesMedium 2620 2300 -12.2% 1.14x (?)
RGBHistogramOfObjects 13300 11700 -12.0% 1.14x
DataReset 2500 2200 -12.0% 1.14x (?)
FloatingPointPrinting_Float80_description_uniform 24900 22000 -11.6% 1.13x (?)
DataToStringMedium 4750 4200 -11.6% 1.13x (?)
DictOfArraysToArrayOfDicts 783 693 -11.5% 1.13x
FloatingPointPrinting_Double_interpolated 49400 43800 -11.3% 1.13x (?)
Dictionary3OfObjects 547 485 -11.3% 1.13x
FilterEvenUsingReduceInto 133 118 -11.3% 1.13x (?)
DataReplaceSmall 2700 2400 -11.1% 1.12x (?)
FloatingPointPrinting_Float80_description_small 25812 23004 -10.9% 1.12x (?)
DataCreateMediumArray 2400 2140 -10.8% 1.12x (?)
CStringLongNonAscii 233 208 -10.7% 1.12x
AngryPhonebook.Armenian.Small 742 663 -10.6% 1.12x (?)
NibbleSort 2640 2360 -10.6% 1.12x
FloatingPointPrinting_Float_interpolated 35200 31600 -10.2% 1.11x
StringBuilderWithLongSubstring 1290 1160 -10.1% 1.11x (?)
DataAppendDataSmallToSmall 3580 3220 -10.1% 1.11x (?)
FloatingPointPrinting_Float80_interpolated 54200 48800 -10.0% 1.11x (?)
StringToDataMedium 3050 2750 -9.8% 1.11x (?)
DataToStringSmall 2550 2300 -9.8% 1.11x (?)
ObjectiveCBridgeFromNSSetAnyObjectToStringForced 83500 75500 -9.6% 1.11x (?)
StringInterpolation 10500 9500 -9.5% 1.11x (?)
MapReduceSequence 554 502 -9.4% 1.10x (?)
RangeAssignment 324 294 -9.3% 1.10x (?)
MapReduceString 56 51 -8.9% 1.10x
CStringLongAscii 220 201 -8.6% 1.09x (?)
RemoveWhereSwapInts 61 56 -8.2% 1.09x (?)
FrequenciesUsingReduce 3488 3203 -8.2% 1.09x
FlattenListLoop 3983 3658 -8.2% 1.09x (?)
ArrayInitFromSlice 337 310 -8.0% 1.09x
UTF8Decode_InitFromBytes_ascii 276 254 -8.0% 1.09x (?)
EqualSubstringSubstring 38 35 -7.9% 1.09x (?)
LessSubstringSubstring 38 35 -7.9% 1.09x
EqualSubstringSubstringGenericEquatable 38 35 -7.9% 1.09x
EqualSubstringString 38 35 -7.9% 1.09x
LessSubstringSubstringGenericComparable 38 35 -7.9% 1.09x
MapReduceAnyCollection 356 328 -7.9% 1.09x
Array2D 6752 6224 -7.8% 1.08x
ArrayPlusEqualFiveElementCollection 7585 6993 -7.8% 1.08x (?)
MapReduce 359 331 -7.8% 1.08x
FlattenListFlatMap 5525 5103 -7.6% 1.08x (?)
DropLastAnySequence 506 468 -7.5% 1.08x (?)
DropLastSequenceLazy 516 478 -7.4% 1.08x (?)
CSVParsingAltIndices2 759 704 -7.2% 1.08x (?)
DropLastSequence 516 479 -7.2% 1.08x
DataAppendDataMediumToSmall 3640 3380 -7.1% 1.08x (?)
RemoveWhereFilterInts 42 39 -7.1% 1.08x (?)
COWTree 3120 2900 -7.1% 1.08x (?)
RandomShuffleLCG2 688 640 -7.0% 1.07x
PrefixWhileAnySeqCRangeIter 319 297 -6.9% 1.07x (?)
PrefixWhileAnySeqCntRange 319 297 -6.9% 1.07x (?)
PrefixWhileSequence 320 298 -6.9% 1.07x (?)

Code size: -O

Performance: -Osize

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 61 70 +14.8% 0.87x (?)
FloatingPointPrinting_Float_description_small 4860 5292 +8.9% 0.92x
 
Improvement OLD NEW DELTA RATIO
ObjectAllocation 152 104 -31.6% 1.46x
FlattenListFlatMap 40937 30007 -26.7% 1.36x
StackPromo 14400 11500 -20.1% 1.25x
DictionarySwapAtOfObjects 7183 5786 -19.4% 1.24x
DictionarySubscriptDefaultMutationOfObjects 1600 1300 -18.7% 1.23x
DictionaryBridgeToObjC_Bridge 16 13 -18.7% 1.23x (?)
COWArrayGuaranteedParameterOverhead 3350 2750 -17.9% 1.22x
MapReduceShortString 17 14 -17.6% 1.21x
ArrayPlusEqualThreeElements 1710 1410 -17.5% 1.21x
MapReduceAnyCollectionShort 1940 1610 -17.0% 1.20x
ArrayOfRef 3710 3120 -15.9% 1.19x
DictionarySubscriptDefaultMutationArrayOfObjects 3540 2980 -15.8% 1.19x
DictionaryGroupOfObjects 1746 1476 -15.5% 1.18x
CharacterPropertiesFetch 3500 2970 -15.1% 1.18x (?)
FloatingPointPrinting_Double_description_small 18600 15800 -15.1% 1.18x (?)
NSError 213 181 -15.0% 1.18x (?)
ArrayOfGenericRef 3740 3180 -15.0% 1.18x
MapReduceShort 2140 1820 -15.0% 1.18x
RangeReplaceableCollectionPlusDefault 776 660 -14.9% 1.18x
DictionarySwapOfObjects 8120 6920 -14.8% 1.17x
DictionaryOfObjects 2225 1905 -14.4% 1.17x
FloatingPointPrinting_Double_description_uniform 20500 17700 -13.7% 1.16x (?)
AngryPhonebook.Cyrillic.Small 757 659 -12.9% 1.15x (?)
FilterEvenUsingReduce 1010 880 -12.9% 1.15x
CStringShortAscii 1480 1290 -12.8% 1.15x
AngryPhonebook.Strasse.Small 879 767 -12.7% 1.15x (?)
Combos 436 381 -12.6% 1.14x (?)
FilterEvenUsingReduceInto 137 120 -12.4% 1.14x
DataMutateBytesMedium 2620 2300 -12.2% 1.14x (?)
FloatingPointPrinting_Float80_description_uniform 24900 21900 -12.0% 1.14x (?)
DataReset 2500 2200 -12.0% 1.14x (?)
DictionaryRemoveOfObjects 27000 23800 -11.9% 1.13x
DataToStringMedium 4700 4150 -11.7% 1.13x (?)
DictOfArraysToArrayOfDicts 803 710 -11.6% 1.13x (?)
ErrorHandling 1310 1160 -11.5% 1.13x (?)
CStringLongNonAscii 236 209 -11.4% 1.13x (?)
AngryPhonebook.Armenian.Small 743 658 -11.4% 1.13x (?)
UTF8Decode_InitDecoding_ascii 230 204 -11.3% 1.13x (?)
FloatingPointPrinting_Float80_description_small 25920 23004 -11.2% 1.13x (?)
DataReplaceSmall 2700 2400 -11.1% 1.12x (?)
UTF8Decode_InitFromData_ascii 229 204 -10.9% 1.12x (?)
UTF8Decode_InitFromBytes_ascii 278 248 -10.8% 1.12x
Dictionary3OfObjects 626 559 -10.7% 1.12x
DataCreateMediumArray 2440 2180 -10.7% 1.12x (?)
FloatingPointPrinting_Double_interpolated 49400 44200 -10.5% 1.12x (?)
MapReduceClassShort2 343 307 -10.5% 1.12x
DataToStringLargeUnicode 5750 5150 -10.4% 1.12x (?)
LessSubstringSubstring 39 35 -10.3% 1.11x
LessSubstringSubstringGenericComparable 39 35 -10.3% 1.11x
FloatingPointPrinting_Float_interpolated 35200 31600 -10.2% 1.11x
SortLettersInPlace 467 420 -10.1% 1.11x
DataAppendArray 4000 3600 -10.0% 1.11x (?)
FloatingPointPrinting_Float80_interpolated 54200 48800 -10.0% 1.11x (?)
StringToDataMedium 3050 2750 -9.8% 1.11x (?)
DataToStringSmall 2550 2300 -9.8% 1.11x (?)
RemoveWhereFilterInts 43 39 -9.3% 1.10x (?)
ParseFloat.Double.Exp 11 10 -9.1% 1.10x (?)
UTF8Decode_InitDecoding_ascii_as_ascii 256 233 -9.0% 1.10x (?)
DataAppendBytesMedium 4080 3720 -8.8% 1.10x (?)
Dictionary2OfObjects 2275 2075 -8.8% 1.10x (?)
MapReduceSequence 593 542 -8.6% 1.09x
StringEdits 76700 70400 -8.2% 1.09x (?)
MapReduceNSDecimalNumberShort 417 383 -8.2% 1.09x
NibbleSort 2960 2720 -8.1% 1.09x (?)
FlattenListLoop 3907 3591 -8.1% 1.09x (?)
ArrayInitFromSlice 336 309 -8.0% 1.09x (?)
String.data.Medium 76 70 -7.9% 1.09x (?)
EqualSubstringString 38 35 -7.9% 1.09x
StringInterpolation 10200 9400 -7.8% 1.09x (?)
ArrayPlusEqualFiveElementCollection 7585 6993 -7.8% 1.08x (?)
EqualSubstringSubstring 39 36 -7.7% 1.08x (?)
EqualStringSubstring 39 36 -7.7% 1.08x
EqualSubstringSubstringGenericEquatable 39 36 -7.7% 1.08x
CSVParsingAltIndices2 880 814 -7.5% 1.08x (?)
MapReduceAnyCollection 390 361 -7.4% 1.08x (?)
MapReduce 391 362 -7.4% 1.08x (?)
RGBHistogramOfObjects 24700 22900 -7.3% 1.08x (?)
ObjectiveCBridgeToNSDictionary 15850 14700 -7.3% 1.08x (?)
DataAppendDataMediumToSmall 3660 3400 -7.1% 1.08x (?)
PrefixWhileAnySeqCRangeIter 321 299 -6.9% 1.07x (?)
PrefixWhileAnySeqCntRange 321 299 -6.9% 1.07x
RangeAssignment 321 299 -6.9% 1.07x (?)
PrefixWhileSequence 322 300 -6.8% 1.07x
RandomShuffleLCG2 720 672 -6.7% 1.07x (?)

Code size: -Osize

Performance: -Onone

Regression OLD NEW DELTA RATIO
ObjectiveCBridgeStringHash 61 70 +14.8% 0.87x
 
Improvement OLD NEW DELTA RATIO
ArrayValueProp 3013 2364 -21.5% 1.27x
ArrayLiteral2 1479 1170 -20.9% 1.26x
COWArrayGuaranteedParameterOverhead 7450 6150 -17.4% 1.21x (?)
DictionaryBridgeToObjC_Bridge 18 15 -16.7% 1.20x (?)
DataAppendDataSmallToSmall 4020 3360 -16.4% 1.20x (?)
ArrayValueProp4 3702 3115 -15.9% 1.19x
ArrayValueProp3 3709 3172 -14.5% 1.17x (?)
FloatingPointPrinting_Double_description_small 19400 16600 -14.4% 1.17x
DataMutateBytesMedium 2700 2380 -11.9% 1.13x
StringBuilderLong 1270 1120 -11.8% 1.13x (?)
UTF8Decode_InitFromData_ascii 231 204 -11.7% 1.13x (?)
DataReset 2600 2300 -11.5% 1.13x (?)
DataReplaceSmall 2700 2400 -11.1% 1.12x (?)
CharacterPropertiesFetch 4910 4380 -10.8% 1.12x (?)
StringInterpolation 11300 10100 -10.6% 1.12x (?)
NSError 535 479 -10.5% 1.12x (?)
ArrayOfPOD 746 669 -10.3% 1.12x
UTF8Decode_InitFromBytes_ascii 278 251 -9.7% 1.11x (?)
StringToDataMedium 3150 2850 -9.5% 1.11x (?)
AngryPhonebook.Cyrillic.Small 904 818 -9.5% 1.11x (?)
UTF8Decode_InitDecoding_ascii_as_ascii 264 239 -9.5% 1.10x (?)
FloatingPointPrinting_Float80_description_small 26352 23868 -9.4% 1.10x (?)
DictionaryLiteral 5580 5060 -9.3% 1.10x (?)
FloatingPointPrinting_Double_description_uniform 31300 28400 -9.3% 1.10x (?)
AngryPhonebook.Armenian.Small 875 794 -9.3% 1.10x (?)
AngryPhonebook.Strasse.Small 998 907 -9.1% 1.10x (?)
DataToStringMedium 4950 4500 -9.1% 1.10x (?)
LessSubstringSubstringGenericComparable 45 41 -8.9% 1.10x
EqualStringSubstring 46 42 -8.7% 1.10x (?)
ArrayPlusEqualThreeElements 6470 5910 -8.7% 1.09x (?)
DataToStringSmall 2950 2700 -8.5% 1.09x (?)
FloatingPointPrinting_Float80_interpolated 87200 80000 -8.3% 1.09x (?)
DataAppendBytesMedium 3980 3660 -8.0% 1.09x (?)
ObjectiveCBridgeStubFromArrayOfNSString2 3100 2860 -7.7% 1.08x (?)
DataAppendArray 3900 3600 -7.7% 1.08x (?)
DictionaryRemoveOfObjects 42800 39600 -7.5% 1.08x (?)
ObjectAllocation 1432 1325 -7.5% 1.08x (?)
StringToDataLargeUnicode 3350 3100 -7.5% 1.08x (?)
Combos 1249 1156 -7.4% 1.08x (?)
DictionarySwapAtOfObjects 15752 14597 -7.3% 1.08x (?)
ArrayOfRef 8540 7920 -7.3% 1.08x (?)
DataAppendDataMediumToSmall 3720 3460 -7.0% 1.08x (?)
Dictionary3OfObjects 1402 1305 -6.9% 1.07x (?)
ArrayPlusEqualSingleElementCollection 173947 161915 -6.9% 1.07x (?)
ArrayPlusEqualFiveElementCollection 138787 129389 -6.8% 1.07x (?)
ClassArrayGetter2 3740 3490 -6.7% 1.07x (?)
LessSubstringSubstring 45 42 -6.7% 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: 8-Core Intel Xeon E5
  Processor Speed: 3 GHz
  Number of Processors: 1
  Total Number of Cores: 8
  L2 Cache (per Core): 256 KB
  L3 Cache: 25 MB
  Memory: 16 GB

@Catfish-Man
Copy link
Contributor Author

Perf still looks good 👍

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0f2d1146cbf7a12382019d279ed505aeda13a77a

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0f2d1146cbf7a12382019d279ed505aeda13a77a

@Catfish-Man
Copy link
Contributor Author

Neat! @mikeash, it looks like the only tests that failed were the ones that would need objc runtime support (which look good locally). I think this might be ready!

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 0f2d1146cbf7a12382019d279ed505aeda13a77a

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 0f2d1146cbf7a12382019d279ed505aeda13a77a

@Catfish-Man
Copy link
Contributor Author

Surprisingly, the 32 bit sim failure looks unrelated to this change.

@Catfish-Man
Copy link
Contributor Author

As is the linux failure

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 254d7fae69334a2a083800a9f0567164f9494717

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 254d7fae69334a2a083800a9f0567164f9494717

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test os x platform

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 254d7fae69334a2a083800a9f0567164f9494717

@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 254d7fae69334a2a083800a9f0567164f9494717

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 254d7fae69334a2a083800a9f0567164f9494717

@Catfish-Man Catfish-Man force-pushed the no-objc-complications-once-more-into-the-breach branch from e0b0646 to ba77426 Compare January 22, 2020 21:50
@Catfish-Man Catfish-Man force-pushed the no-objc-complications-once-more-into-the-breach branch from ba77426 to f36a4db Compare January 22, 2020 21:55
@Catfish-Man
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e0b0646fff80076368ee1cacd55d0b79c19e5045

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - e0b0646fff80076368ee1cacd55d0b79c19e5045

@Catfish-Man Catfish-Man merged commit 8e09cd2 into swiftlang:master Jan 23, 2020
}

LLVM_ATTRIBUTE_ALWAYS_INLINE
void setIsImmortal(bool value) {
setField(IsImmortal, value);
assert(value);
Copy link
Contributor

Choose a reason for hiding this comment

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

If value must be true, should this even take a parameter?

@@ -369,33 +388,56 @@ class RefCountBitsT {
enum Immortal_t { Immortal };

LLVM_ATTRIBUTE_ALWAYS_INLINE
bool isImmortal() const {
return bool(getField(IsImmortal));
bool isImmortal(bool checkSlowRCBit) const {
Copy link
Contributor

Choose a reason for hiding this comment

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

Since this is always called with a constant true or false, it might be clearer to just split it into two functions.

static bool _check_fast_dealloc() {
//This will always be in libobjc, so RTLD_DEFAULT won't have to do an
//expensive search in practice
return dlsym(RTLD_DEFAULT, "_objc_has_weak_formation_callout") != nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

We're using RTLD_NEXT in a couple of other places, which ensures we don't go off looking at a ton of other dylibs.

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.

3 participants