WebKit Bugzilla
Attachment 342930 Details for
Bug 186762
: [WTF] Remove workarounds needed to support libstdc++-4
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-186762-20180618155742.patch (text/plain), 12.83 KB, created by
Carlos Alberto Lopez Perez
on 2018-06-18 06:57:44 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Carlos Alberto Lopez Perez
Created:
2018-06-18 06:57:44 PDT
Size:
12.83 KB
patch
obsolete
>Subversion Revision: 232927 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 81f49f6df83e75abf4ed7f9954708a631bc212de..bd56a8dd93a4ccae3ab6ec3042434eaa1b2ca53e 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-06-18 Carlos Alberto Lopez Perez <clopez@igalia.com> >+ >+ [WTF] Remove workarounds needed to support libstdc++-4 >+ https://bugs.webkit.org/show_bug.cgi?id=186762 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Revert r226299, r226300 r226301 and r226302. >+ >+ * API/tests/TypedArrayCTest.cpp: >+ (assertEqualsAsNumber): >+ * runtime/JSArray.cpp: >+ (JSC::JSArray::unshiftCountSlowCase): >+ (JSC::JSArray::setLengthWithArrayStorage): >+ (JSC::JSArray::shiftCountWithArrayStorage): >+ (JSC::JSArray::fillArgList): >+ (JSC::JSArray::copyToArguments): >+ > 2018-06-16 Michael Catanzaro <mcatanzaro@igalia.com> > > REGRESSION(r227717): Hardcoded page size causing JSC crashes on platforms with page size bigger than 16 KB >diff --git a/Source/WTF/ChangeLog b/Source/WTF/ChangeLog >index daf38a3bd6e048cfc8a2c1169ff50cc9f80f0e76..d6fc078fa3d07e2f9d6d6655e0b12b29648d1d31 100644 >--- a/Source/WTF/ChangeLog >+++ b/Source/WTF/ChangeLog >@@ -1,3 +1,14 @@ >+2018-06-18 Carlos Alberto Lopez Perez <clopez@igalia.com> >+ >+ [WTF] Remove workarounds needed to support libstdc++-4 >+ https://bugs.webkit.org/show_bug.cgi?id=186762 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Revert r226299, r226300 r226301 and r226302- >+ >+ * wtf/StdLibExtras.h: >+ > 2018-06-12 Darin Adler <darin@apple.com> > > [Cocoa] Make some RetainPtr refinements to get more ready for ARC >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index f84388bac660b5cae0b6fa92a35ef2f7924cfd45..bea9db564581f713fbc52d021851cf7ca3923a59 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,21 @@ >+2018-06-18 Carlos Alberto Lopez Perez <clopez@igalia.com> >+ >+ [WTF] Remove workarounds needed to support libstdc++-4 >+ https://bugs.webkit.org/show_bug.cgi?id=186762 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Revert r226299, r226300 r226301 and r226302. >+ >+ No new tests, no change in behaviour. >+ >+ * platform/graphics/FontSelectionAlgorithm.h: >+ (WebCore::FontSelectionValue::clampFloat): >+ * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: >+ (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const): >+ * platform/graphics/win/UniscribeController.cpp: >+ (WebCore::UniscribeController::shapeAndPlaceItem): >+ > 2018-06-18 Philippe Normand <pnormand@igalia.com> > > [GStreamer] Crash when adding in-band text track with playbin3 enabled >diff --git a/Source/JavaScriptCore/API/tests/TypedArrayCTest.cpp b/Source/JavaScriptCore/API/tests/TypedArrayCTest.cpp >index 91835b2567c66ee365d610d6ae90756b01f20abd..b81b269ef68b6761596ad69196ef97f02b9100e0 100644 >--- a/Source/JavaScriptCore/API/tests/TypedArrayCTest.cpp >+++ b/Source/JavaScriptCore/API/tests/TypedArrayCTest.cpp >@@ -27,7 +27,6 @@ > #include "TypedArrayCTest.h" > > #include "JavaScript.h" >-#include <cmath> > #include <limits.h> > #include <math.h> > #include <stdio.h> >@@ -85,7 +84,7 @@ inline int unexpectedException(const char* name) > static int assertEqualsAsNumber(JSGlobalContextRef context, JSValueRef value, double expectedValue) > { > double number = JSValueToNumber(context, value, nullptr); >- if (number != expectedValue && !(std::isnan(number) && std::isnan(expectedValue))) { >+ if (number != expectedValue && !(isnan(number) && isnan(expectedValue))) { > fprintf(stderr, "assertEqualsAsNumber FAILED: %p, %lf\n", value, expectedValue); > return 1; > } >diff --git a/Source/JavaScriptCore/runtime/JSArray.cpp b/Source/JavaScriptCore/runtime/JSArray.cpp >index 1ad6eb3edf2182d29b074a333a06f7cf8ce212ae..2e496f5ed136d1490fa50fc2a3af46e755701804 100644 >--- a/Source/JavaScriptCore/runtime/JSArray.cpp >+++ b/Source/JavaScriptCore/runtime/JSArray.cpp >@@ -345,7 +345,7 @@ bool JSArray::unshiftCountSlowCase(const AbstractLocker&, VM& vm, DeferGC&, bool > > unsigned length = storage->length(); > unsigned oldVectorLength = storage->vectorLength(); >- unsigned usedVectorLength = std::min(oldVectorLength, length); >+ unsigned usedVectorLength = min(oldVectorLength, length); > ASSERT(usedVectorLength <= MAX_STORAGE_VECTOR_LENGTH); > // Check that required vector length is possible, in an overflow-safe fashion. > if (count > MAX_STORAGE_VECTOR_LENGTH - usedVectorLength) >@@ -359,7 +359,7 @@ bool JSArray::unshiftCountSlowCase(const AbstractLocker&, VM& vm, DeferGC&, bool > // FIXME: This code should be fixed to avoid internal fragmentation. It's not super high > // priority since increaseVectorLength() will "fix" any mistakes we make, but it would be cool > // to get this right eventually. >- unsigned desiredCapacity = std::min(MAX_STORAGE_VECTOR_LENGTH, std::max(BASE_ARRAY_STORAGE_VECTOR_LEN, requiredVectorLength) << 1); >+ unsigned desiredCapacity = min(MAX_STORAGE_VECTOR_LENGTH, max(BASE_ARRAY_STORAGE_VECTOR_LEN, requiredVectorLength) << 1); > > // Step 2: > // We're either going to choose to allocate a new ArrayStorage, or we're going to reuse the existing one. >@@ -395,7 +395,7 @@ bool JSArray::unshiftCountSlowCase(const AbstractLocker&, VM& vm, DeferGC&, bool > postCapacity = newStorageCapacity - requiredVectorLength; > else if (length < storage->vectorLength()) { > // Atomic decay, + the post-capacity cannot be greater than what is available. >- postCapacity = std::min((storage->vectorLength() - length) >> 1, newStorageCapacity - requiredVectorLength); >+ postCapacity = min((storage->vectorLength() - length) >> 1, newStorageCapacity - requiredVectorLength); > // If we're moving contents within the same allocation, the post-capacity is being reduced. > ASSERT(newAllocBase != butterfly->base(structure) || postCapacity < storage->vectorLength() - length); > } >@@ -451,7 +451,7 @@ bool JSArray::setLengthWithArrayStorage(ExecState* exec, unsigned newLength, boo > if (newLength < length) { > // Copy any keys we might be interested in into a vector. > Vector<unsigned, 0, UnsafeVectorOverflow> keys; >- keys.reserveInitialCapacity(std::min(map->size(), static_cast<size_t>(length - newLength))); >+ keys.reserveInitialCapacity(min(map->size(), static_cast<size_t>(length - newLength))); > SparseArrayValueMap::const_iterator end = map->end(); > for (SparseArrayValueMap::const_iterator it = map->begin(); it != end; ++it) { > unsigned index = static_cast<unsigned>(it->key); >@@ -486,7 +486,7 @@ bool JSArray::setLengthWithArrayStorage(ExecState* exec, unsigned newLength, boo > > if (newLength < length) { > // Delete properties from the vector. >- unsigned usedVectorLength = std::min(length, storage->vectorLength()); >+ unsigned usedVectorLength = min(length, storage->vectorLength()); > for (unsigned i = newLength; i < usedVectorLength; ++i) { > WriteBarrier<Unknown>& valueSlot = storage->m_vector[i]; > bool hadValue = !!valueSlot; >@@ -827,7 +827,7 @@ bool JSArray::shiftCountWithArrayStorage(VM& vm, unsigned startIndex, unsigned c > if (startIndex + count > vectorLength) > count = vectorLength - startIndex; > >- unsigned usedVectorLength = std::min(vectorLength, oldLength); >+ unsigned usedVectorLength = min(vectorLength, oldLength); > > unsigned numElementsBeforeShiftRegion = startIndex; > unsigned firstIndexAfterShiftRegion = startIndex + count; >@@ -1231,7 +1231,7 @@ void JSArray::fillArgList(ExecState* exec, MarkedArgumentBuffer& args) > ArrayStorage* storage = butterfly->arrayStorage(); > > vector = storage->m_vector; >- vectorEnd = std::min(storage->length(), storage->vectorLength()); >+ vectorEnd = min(storage->length(), storage->vectorLength()); > break; > } > >@@ -1303,7 +1303,7 @@ void JSArray::copyToArguments(ExecState* exec, VirtualRegister firstElementDest, > case ARRAY_WITH_ARRAY_STORAGE_INDEXING_TYPES: { > ArrayStorage* storage = butterfly->arrayStorage(); > vector = storage->m_vector; >- vectorEnd = std::min(length, storage->vectorLength()); >+ vectorEnd = min(length, storage->vectorLength()); > break; > } > >diff --git a/Source/WTF/wtf/StdLibExtras.h b/Source/WTF/wtf/StdLibExtras.h >index 760b2ad9302d481eb1e9a7190969970f93f85210..6492dbfa02c54e14719f9dfc0e6ea19040713d44 100644 >--- a/Source/WTF/wtf/StdLibExtras.h >+++ b/Source/WTF/wtf/StdLibExtras.h >@@ -27,7 +27,6 @@ > #ifndef WTF_StdLibExtras_h > #define WTF_StdLibExtras_h > >-#include <algorithm> > #include <cstring> > #include <memory> > #include <type_traits> >@@ -455,24 +454,6 @@ inline constexpr std::tuple<Args&...> tie(Args&... values) > return std::tuple<Args&...>(values...); > } > >-// libstdc++4 does not have constexpr std::min or std::max. >-// As a workaround this defines WTF::min and WTF::max with constexpr, to be used when a constexpr result is expected. >-// This workaround can be removed after 2018-06 and all users of WTF::min and WTF::max can be converted to std::min and std::max. >-// For more info see: https://bugs.webkit.org/show_bug.cgi?id=181160 >-template <class T> >-inline constexpr const T& min(const T& a, const T& b) >-{ >- return std::min(a, b); >-} >- >-template <class T> >-inline constexpr const T& max(const T& a, const T& b) >-{ >- return std::max(a, b); >-} >- >-} // namespace WTF >- > // This version of placement new omits a 0 check. > enum NotNullTag { NotNull }; > inline void* operator new(size_t, NotNullTag, void* location) >diff --git a/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h b/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h >index c47b2aa9400a277e52255fc87224515dd2c154e6..b2a582aef65072cdd4fe1fc562bdb8fbe03a4819 100644 >--- a/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h >+++ b/Source/WebCore/platform/graphics/FontSelectionAlgorithm.h >@@ -30,7 +30,6 @@ > #include <tuple> > #include <wtf/Hasher.h> > #include <wtf/Optional.h> >-#include <wtf/StdLibExtras.h> > > namespace WebCore { > >@@ -103,7 +102,7 @@ constexpr FontSelectionValue FontSelectionValue::minimumValue() > > constexpr FontSelectionValue FontSelectionValue::clampFloat(float value) > { >- return FontSelectionValue { WTF::max<float>(minimumValue(), WTF::min<float>(value, maximumValue())) }; >+ return FontSelectionValue { std::max<float>(minimumValue(), std::min<float>(value, maximumValue())) }; > } > > constexpr FontSelectionValue::FontSelectionValue(int rawValue, RawTag) >diff --git a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >index a2dee20b2ee628050a235476a7a24862c13122b3..086c53e6b9019303c8cb4d0077ef3839b55d66d0 100644 >--- a/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >+++ b/Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp >@@ -600,7 +600,7 @@ MediaTime MediaPlayerPrivateAVFoundationCF::currentMediaTime() const > > CMTime itemTime = AVCFPlayerItemGetCurrentTime(avPlayerItem(m_avfWrapper)); > if (CMTIME_IS_NUMERIC(itemTime)) >- return std::max(PAL::toMediaTime(itemTime), MediaTime::zeroTime()); >+ return max(PAL::toMediaTime(itemTime), MediaTime::zeroTime()); > > return MediaTime::zeroTime(); > } >diff --git a/Source/WebCore/platform/graphics/win/UniscribeController.cpp b/Source/WebCore/platform/graphics/win/UniscribeController.cpp >index 5bcc23f9755c275df76e62dd2c077a2e4d21c8d0..35d793571c721baa6fed33f80150372e893e4003 100644 >--- a/Source/WebCore/platform/graphics/win/UniscribeController.cpp >+++ b/Source/WebCore/platform/graphics/win/UniscribeController.cpp >@@ -370,10 +370,10 @@ bool UniscribeController::shapeAndPlaceItem(const UChar* cp, unsigned i, const F > > FloatRect glyphBounds = fontData->boundsForGlyph(glyph); > glyphBounds.move(m_glyphOrigin.x(), m_glyphOrigin.y()); >- m_minGlyphBoundingBoxX = std::min(m_minGlyphBoundingBoxX, glyphBounds.x()); >- m_maxGlyphBoundingBoxX = std::max(m_maxGlyphBoundingBoxX, glyphBounds.maxX()); >- m_minGlyphBoundingBoxY = std::min(m_minGlyphBoundingBoxY, glyphBounds.y()); >- m_maxGlyphBoundingBoxY = std::max(m_maxGlyphBoundingBoxY, glyphBounds.maxY()); >+ m_minGlyphBoundingBoxX = min(m_minGlyphBoundingBoxX, glyphBounds.x()); >+ m_maxGlyphBoundingBoxX = max(m_maxGlyphBoundingBoxX, glyphBounds.maxX()); >+ m_minGlyphBoundingBoxY = min(m_minGlyphBoundingBoxY, glyphBounds.y()); >+ m_maxGlyphBoundingBoxY = max(m_maxGlyphBoundingBoxY, glyphBounds.maxY()); > m_glyphOrigin.move(advance + offsetX, -offsetY); > > // Mutate the glyph array to contain our altered advances.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 186762
:
342930
|
342931
|
342933