Changeset 275856 in webkit
- Timestamp:
- Apr 12, 2021, 7:04:15 PM (6 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 1 added
- 6 edited
-
ChangeLog (modified) (1 diff)
-
JavaScriptCore.xcodeproj/project.pbxproj (modified) (13 diffs)
-
Sources.txt (modified) (1 diff)
-
runtime/IntlSegmenter.cpp (modified) (1 diff)
-
runtime/IntlSegmenter.h (modified) (1 diff)
-
runtime/IntlSegments.cpp (modified) (1 diff)
-
runtime/IntlWorkaround.cpp (added)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r275850 r275856 1 2021-04-12 Ross Kirsling <ross.kirsling@sony.com> 2 3 ICU 69 deprecates ubrk_safeClone in favor of ubrk_clone 4 https://bugs.webkit.org/show_bug.cgi?id=224093 5 6 Reviewed by Yusuke Suzuki. 7 8 In a shining example of "disappointing library practices", ICU 69 deprecates ubrk_safeClone in favor of 9 a new *draft* API ubrk_clone, meaning that no function with this functionality is exposed by default. 10 11 This patch introduces a function cloneUBreakIterator to abstract over this change; however, since we need to: 12 13 1. confine the effects of disabling U_HIDE_DRAFT_API to a non-unified implementation file 14 2. still be able to include ubrk.h from IntlSegmenter.h to instantiate ICUDeleter<ubrk_close> (*not* `clone`!) 15 16 ...the new helper function is introduced in a *headerless* implementation file, IntlWorkaround.cpp. 17 18 * JavaScriptCore.xcodeproj/project.pbxproj: 19 * Sources.txt: 20 * runtime/IntlSegmenter.cpp: 21 (JSC::IntlSegmenter::segment const): 22 * runtime/IntlSegmenter.h: 23 * runtime/IntlSegments.cpp: 24 (JSC::IntlSegments::createSegmentIterator): 25 * runtime/IntlWorkaround.cpp: Added. 26 (JSC::cloneUBreakIterator): 27 1 28 2021-04-12 Don Olmstead <don.olmstead@sony.com> 2 29 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r275797 r275856 1403 1403 A1D793011B43864B004516F5 /* IntlNumberFormatPrototype.h in Headers */ = {isa = PBXBuildFile; fileRef = A1D792FB1B43864B004516F5 /* IntlNumberFormatPrototype.h */; }; 1404 1404 A38D250E25800D440042BFDD /* JSArrayBufferPrototypeInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = A38D250D25800D430042BFDD /* JSArrayBufferPrototypeInlines.h */; }; 1405 A3EE8543262514B000FC9B8D /* IntlWorkaround.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A37619402625127C00CBCBA9 /* IntlWorkaround.cpp */; }; 1405 1406 A3FF9BC72234749100B1A9AB /* YarrFlags.h in Headers */ = {isa = PBXBuildFile; fileRef = A3FF9BC52234746600B1A9AB /* YarrFlags.h */; settings = {ATTRIBUTES = (Private, ); }; }; 1406 1407 A503FA1A188E0FB000110F14 /* JavaScriptCallFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = A503FA14188E0FAF00110F14 /* JavaScriptCallFrame.h */; }; … … 4420 4421 A1FE1EB01C2C537E00A289FF /* DatePrototype.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = DatePrototype.js; sourceTree = "<group>"; }; 4421 4422 A27958D7FA1142B0AC9E364D /* WasmContextInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WasmContextInlines.h; sourceTree = "<group>"; }; 4423 A37619402625127C00CBCBA9 /* IntlWorkaround.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntlWorkaround.cpp; sourceTree = "<group>"; }; 4422 4424 A38D250D25800D430042BFDD /* JSArrayBufferPrototypeInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSArrayBufferPrototypeInlines.h; sourceTree = "<group>"; }; 4423 4425 A3AFF92B245A3CF900C9BA3B /* IntlLocale.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntlLocale.h; sourceTree = "<group>"; }; … … 7289 7291 BCD203470E17135E002C7E82 /* DatePrototype.cpp */, 7290 7292 BCD203480E17135E002C7E82 /* DatePrototype.h */, 7291 FE9F3FC626163CA90069E89F /* DeferTermination.h */,7292 7293 534638761E71E06E00F12AC1 /* DeferredWorkTimer.cpp */, 7293 7294 534638741E70DDEC00F12AC1 /* DeferredWorkTimer.h */, 7295 FE9F3FC626163CA90069E89F /* DeferTermination.h */, 7294 7296 169948EDE68D4054B01EF797 /* DefinePropertyAttributes.h */, 7295 7297 734B655423F4A33100A069D1 /* DeletePropertySlot.h */, … … 7477 7479 E3F2193224C7882A003AE453 /* IntlSegmentsPrototype.cpp */, 7478 7480 E3F2193624C7882B003AE453 /* IntlSegmentsPrototype.h */, 7481 A37619402625127C00CBCBA9 /* IntlWorkaround.cpp */, 7479 7482 0F275F2C1ECE079600620D47 /* Intrinsic.cpp */, 7480 7483 86BF642A148DB2B5004DE36A /* Intrinsic.h */, … … 9231 9234 8BC0648A1E1ABA7B00B2B8CA /* AsyncGeneratorFunctionPrototype.h in Headers */, 9232 9235 8BC064921E1ADCC400B2B8CA /* AsyncGeneratorPrototype.h in Headers */, 9233 BCE2FAFF26091782000A510F /* WeakGCHashTable.h in Headers */,9234 9236 8B3BF5E41E3D368B0076A87A /* AsyncGeneratorPrototype.lut.h in Headers */, 9235 9237 8BC064961E1D845C00B2B8CA /* AsyncIteratorPrototype.h in Headers */, … … 9499 9501 FE5068651AE246390009DAB7 /* DeferredSourceDump.h in Headers */, 9500 9502 534638751E70DDEC00F12AC1 /* DeferredWorkTimer.h in Headers */, 9503 FE9F3FC826163CA90069E89F /* DeferTermination.h in Headers */, 9501 9504 473DA4A4764C45FE871B0485 /* DefinePropertyAttributes.h in Headers */, 9502 9505 0FBB73BB1DEF8645002C009E /* DeleteAllCodeEffort.h in Headers */, … … 9512 9515 0F4F11EB209D426600709654 /* DFGAbstractValueClobberEpoch.h in Headers */, 9513 9516 0FD3E4021B618AAF00C80E1E /* DFGAdaptiveInferredPropertyValueWatchpoint.h in Headers */, 9514 FE9F3FB92613C7890069E89F /* ResourceExhaustion.h in Headers */,9515 9517 0F18D3D01B55A6E0002C5C9F /* DFGAdaptiveStructureWatchpoint.h in Headers */, 9516 9518 0F66E16B14DF3F1600B7B2E4 /* DFGAdjacencyList.h in Headers */, … … 9667 9669 0FC20CB61852E2C600C9E954 /* DFGStrengthReductionPhase.h in Headers */, 9668 9670 0F63947815DCE34B006A597C /* DFGStructureAbstractValue.h in Headers */, 9669 FE9F3FC826163CA90069E89F /* DeferTermination.h in Headers */,9670 9671 0F50AF3C193E8B3900674EE8 /* DFGStructureClobberState.h in Headers */, 9671 9672 0F2FCCFF18A60070001A27F8 /* DFGThreadData.h in Headers */, … … 9697 9698 0F37308F1C0CD68500052BFA /* DisallowMacroScratchRegisterUsage.h in Headers */, 9698 9699 FE54DEFF1E8D76FA00A892C5 /* DisallowScope.h in Headers */, 9699 BCE2FAFB260916EF000A510F /* WeakGCSet.h in Headers */,9700 9700 FE54DEFB1E8C6D8800A892C5 /* DisallowVMEntry.h in Headers */, 9701 9701 0FF42731158EBD54004CB9FF /* Disassembler.h in Headers */, … … 10355 10355 FE64872E2141D04800AB0D3E /* OpcodeInlines.h in Headers */, 10356 10356 14A4680D216FA56A000D2B1A /* OpcodeSize.h in Headers */, 10357 BCE2FAFD260916FF000A510F /* WeakGCSetInlines.h in Headers */,10358 10357 0F2BDC2C151FDE9100CD8910 /* Operands.h in Headers */, 10359 10358 A70447EA17A0BD4600F5898E /* OperandsInlines.h in Headers */, … … 10462 10461 992F56B71E4E84B20035953B /* RemoteInspectorXPCConnection.h in Headers */, 10463 10462 0F24E55117EE274900ABB217 /* Repatch.h in Headers */, 10463 FE9F3FB92613C7890069E89F /* ResourceExhaustion.h in Headers */, 10464 10464 869EBCB70E8C6D4A008722CC /* ResultType.h in Headers */, 10465 10465 FE3B642F25D6FB4D001ADDB4 /* RootMarkReason.h in Headers */, … … 10688 10688 142E313C134FF0A600AFADB5 /* Weak.h in Headers */, 10689 10689 14E84F9F14EE1ACC00D6D5D4 /* WeakBlock.h in Headers */, 10690 BCE2FAFF26091782000A510F /* WeakGCHashTable.h in Headers */, 10690 10691 14BFCE6910CDB1FC00364CCE /* WeakGCMap.h in Headers */, 10691 10692 AD86A93E1AA4D88D002FE77F /* WeakGCMapInlines.h in Headers */, 10693 BCE2FAFB260916EF000A510F /* WeakGCSet.h in Headers */, 10694 BCE2FAFD260916FF000A510F /* WeakGCSetInlines.h in Headers */, 10692 10695 14F7256614EE265E00B1652B /* WeakHandleOwner.h in Headers */, 10693 10696 14E84FA214EE1ACC00D6D5D4 /* WeakImpl.h in Headers */, … … 11564 11567 E399AEC32559457F00B78485 /* IntlDateTimeFormat.cpp in Sources */, 11565 11568 E366441E254409B30001876F /* IntlListFormat.cpp in Sources */, 11569 A3EE8543262514B000FC9B8D /* IntlWorkaround.cpp in Sources */, 11566 11570 E38E8790254B978400F6F9E4 /* JSDateMath.cpp in Sources */, 11567 11571 536B319E1F735F160037FC33 /* LowLevelInterpreter.cpp in Sources */, -
trunk/Source/JavaScriptCore/Sources.txt
r275243 r275856 850 850 runtime/IntlSegments.cpp 851 851 runtime/IntlSegmentsPrototype.cpp 852 runtime/IntlWorkaround.cpp @no-unify // Confine U_HIDE_DRAFT_API's effect to this file. 852 853 runtime/IteratorOperations.cpp 853 854 runtime/IteratorPrototype.cpp -
trunk/Source/JavaScriptCore/runtime/IntlSegmenter.cpp
r275410 r275856 126 126 127 127 UErrorCode status = U_ZERO_ERROR; 128 auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>( ubrk_safeClone(m_segmenter.get(), nullptr, nullptr, &status));128 auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(cloneUBreakIterator(m_segmenter.get(), &status)); 129 129 if (U_FAILURE(status)) { 130 130 throwTypeError(globalObject, scope, "failed to initialize Segments"_s); -
trunk/Source/JavaScriptCore/runtime/IntlSegmenter.h
r266032 r275856 76 76 }; 77 77 78 // Abstraction to call ubrk_safeClone or ubrk_clone depending on ICU version. 79 // This is implemented in IntlWorkaround.cpp in order to confine draft API visibility. 80 UBreakIterator* cloneUBreakIterator(const UBreakIterator*, UErrorCode*); 81 78 82 } // namespace JSC -
trunk/Source/JavaScriptCore/runtime/IntlSegments.cpp
r273138 r275856 101 101 102 102 UErrorCode status = U_ZERO_ERROR; 103 auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>( ubrk_safeClone(m_segmenter.get(), nullptr, nullptr, &status));103 auto segmenter = std::unique_ptr<UBreakIterator, UBreakIteratorDeleter>(cloneUBreakIterator(m_segmenter.get(), &status)); 104 104 if (U_FAILURE(status)) { 105 105 throwTypeError(globalObject, scope, "failed to initialize SegmentIterator"_s);
Note:
See TracChangeset
for help on using the changeset viewer.