Bug 1554063 - Move decimal to mozglue. r=jwalden
☠☠ backed out by 8f8700dd6d56 ☠ ☠
authorMike Hommey <mh+mozilla@glandium.org>
Wed, 29 May 2019 00:59:20 +0000
changeset 538834 3edc5be703bef8ad5e78a0ec9b08e98c69cf026b
parent 538833 e78c08a8a56c85a7a1e9e86364f672ea8e93cf73
child 538835 094829c443f30c614689eac605e243afb7720a45
push id2131
push userffxbld-merge
push dateMon, 26 Aug 2019 18:30:20 +0000
treeherdermozilla-release@b19ffb3ca153 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwalden
bugs1554063
milestone69.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1554063 - Move decimal to mozglue. r=jwalden Differential Revision: https://phabricator.services.mozilla.com/D32435
.clang-format-ignore
config/check_spidermonkey_style.py
mfbt/decimal/Decimal.cpp
mfbt/decimal/Decimal.h
mfbt/decimal/UPSTREAM-GIT-SHA
mfbt/decimal/comparison-with-nan.patch
mfbt/decimal/fix-wshadow-warnings.patch
mfbt/decimal/mfbt-abi-markers.patch
mfbt/decimal/moz-decimal-utils.h
mfbt/decimal/to-moz-dependencies.patch
mfbt/decimal/update.sh
mfbt/decimal/zero-serialization.patch
mfbt/moz.build
mozglue/misc/decimal/Decimal.cpp
mozglue/misc/decimal/Decimal.h
mozglue/misc/decimal/UPSTREAM-GIT-SHA
mozglue/misc/decimal/comparison-with-nan.patch
mozglue/misc/decimal/fix-wshadow-warnings.patch
mozglue/misc/decimal/mfbt-abi-markers.patch
mozglue/misc/decimal/moz-decimal-utils.h
mozglue/misc/decimal/to-moz-dependencies.patch
mozglue/misc/decimal/update.sh
mozglue/misc/decimal/zero-serialization.patch
mozglue/misc/moz.build
tools/rewriting/ThirdPartyPaths.txt
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -131,30 +131,30 @@ media/libvorbis/.*
 media/libvpx/.*
 media/libwebp/.*
 media/libyuv/.*
 media/mtransport/third_party/.*
 media/openmax_dl/.*
 media/openmax_il/.*
 media/webrtc/signaling/src/sdp/sipcc/.*
 media/webrtc/trunk/.*
-mfbt/decimal/.*
 mfbt/double-conversion/double-conversion/.*
 mfbt/lz4.*
 mobile/android/geckoview/src/thirdparty/.*
 mobile/android/thirdparty/.*
 modules/brotli/.*
 modules/fdlibm/.*
 modules/freetype2/.*
 modules/libbz2/.*
 modules/libmar/.*
 modules/pdfium/.*
 modules/woff2/.*
 modules/xz-embedded/.*
 modules/zlib/.*
+mozglue/misc/decimal/.*
 netwerk/dns/nsIDNKitInterface.h
 netwerk/sctp/src/.*
 netwerk/srtp/src/.*
 nsprpub/.*
 other-licenses/.*
 parser/expat/.*
 security/nss/.*
 security/sandbox/chromium/.*
--- a/config/check_spidermonkey_style.py
+++ b/config/check_spidermonkey_style.py
@@ -241,17 +241,16 @@ class FileKind(object):
 
 def check_style(enable_fixup):
     # We deal with two kinds of name.
     # - A "filename" is a full path to a file from the repository root.
     # - An "inclname" is how a file is referred to in a #include statement.
     #
     # Examples (filename -> inclname)
     # - "mfbt/Attributes.h"         -> "mozilla/Attributes.h"
-    # - "mfbt/decimal/Decimal.h     -> "mozilla/Decimal.h"
     # - "mozglue/misc/TimeStamp.h   -> "mozilla/TimeStamp.h"
     # - "memory/mozalloc/mozalloc.h -> "mozilla/mozalloc.h"
     # - "js/public/Vector.h"        -> "js/Vector.h"
     # - "js/src/vm/String.h"        -> "vm/String.h"
 
     non_js_dirnames = ('mfbt/',
                        'memory/mozalloc/',
                        'mozglue/')  # type: tuple(str)
--- a/mfbt/moz.build
+++ b/mfbt/moz.build
@@ -26,17 +26,16 @@ EXPORTS.mozilla = [
     'Casting.h',
     'ChaosMode.h',
     'Char16.h',
     'CheckedInt.h',
     'Compiler.h',
     'Compression.h',
     'DbgMacro.h',
     'DebugOnly.h',
-    'decimal/Decimal.h',
     'DefineEnum.h',
     'DoublyLinkedList.h',
     'EndianUtils.h',
     'EnumeratedArray.h',
     'EnumeratedRange.h',
     'EnumSet.h',
     'EnumTypeTraits.h',
     'FastBernoulliTrial.h',
@@ -164,22 +163,17 @@ if CONFIG['MOZ_BUILD_APP'] not in ('memo
     # Building MFBT tests adds a large overhead when building
     # tools/crashreporter.
     TEST_DIRS += ['tests']
 
 DEFINES['IMPL_MFBT'] = True
 
 SOURCES += [
     'Compression.cpp',
-    'decimal/Decimal.cpp',
     'lz4.c',
 ]
 
 DisableStlWrapping()
 
-if CONFIG['CC_TYPE'] == 'clang':
-    # Suppress warnings from third-party V8 Decimal code.
-    SOURCES['decimal/Decimal.cpp'].flags += ['-Wno-implicit-fallthrough']
-
 if CONFIG['MOZ_NEEDS_LIBATOMIC']:
     OS_LIBS += ['atomic']
 
 DEFINES['LZ4LIB_VISIBILITY'] = ''
rename from mfbt/decimal/Decimal.cpp
rename to mozglue/misc/decimal/Decimal.cpp
rename from mfbt/decimal/Decimal.h
rename to mozglue/misc/decimal/Decimal.h
rename from mfbt/decimal/UPSTREAM-GIT-SHA
rename to mozglue/misc/decimal/UPSTREAM-GIT-SHA
rename from mfbt/decimal/comparison-with-nan.patch
rename to mozglue/misc/decimal/comparison-with-nan.patch
--- a/mfbt/decimal/comparison-with-nan.patch
+++ b/mozglue/misc/decimal/comparison-with-nan.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp
---- a/mfbt/decimal/Decimal.cpp
-+++ b/mfbt/decimal/Decimal.cpp
+diff --git a/mozglue/misc/decimal/Decimal.cpp b/mozglue/misc/decimal/Decimal.cpp
+--- a/mozglue/misc/decimal/Decimal.cpp
++++ b/mozglue/misc/decimal/Decimal.cpp
 @@ -509,21 +509,25 @@ Decimal Decimal::operator/(const Decimal
      if (remainder > divisor / 2)
          ++result;
  
      return Decimal(resultSign, resultExponent, result);
  }
  
  bool Decimal::operator==(const Decimal& rhs) const
rename from mfbt/decimal/fix-wshadow-warnings.patch
rename to mozglue/misc/decimal/fix-wshadow-warnings.patch
--- a/mfbt/decimal/fix-wshadow-warnings.patch
+++ b/mozglue/misc/decimal/fix-wshadow-warnings.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp
---- a/mfbt/decimal/Decimal.cpp
-+++ b/mfbt/decimal/Decimal.cpp
+diff --git a/mozglue/misc/decimal/Decimal.cpp b/mozglue/misc/decimal/Decimal.cpp
+--- a/mozglue/misc/decimal/Decimal.cpp
++++ b/mozglue/misc/decimal/Decimal.cpp
 @@ -118,18 +118,18 @@ Decimal SpecialValueHandler::value() con
          ASSERT_NOT_REACHED();
          return m_lhs;
      }
  }
  
  // This class is used for 128 bit unsigned integer arithmetic.
  class UInt128 {
@@ -142,19 +142,19 @@ diff --git a/mfbt/decimal/Decimal.cpp b/
          ++result;
  
      return Decimal(resultSign, resultExponent, result);
  }
  
  bool Decimal::operator==(const Decimal& rhs) const
  {
      if (isNaN() || rhs.isNaN())
-diff --git a/mfbt/decimal/Decimal.h b/mfbt/decimal/Decimal.h
---- a/mfbt/decimal/Decimal.h
-+++ b/mfbt/decimal/Decimal.h
+diff --git a/mozglue/misc/decimal/Decimal.h b/mozglue/misc/decimal/Decimal.h
+--- a/mozglue/misc/decimal/Decimal.h
++++ b/mozglue/misc/decimal/Decimal.h
 @@ -88,17 +88,17 @@ public:
          int countDigits() const;
          int exponent() const { return m_exponent; }
          bool isFinite() const { return !isSpecial(); }
          bool isInfinity() const { return m_formatClass == ClassInfinity; }
          bool isNaN() const { return m_formatClass == ClassNaN; }
          bool isSpecial() const { return m_formatClass == ClassInfinity || m_formatClass == ClassNaN; }
          bool isZero() const { return m_formatClass == ClassZero; }
rename from mfbt/decimal/mfbt-abi-markers.patch
rename to mozglue/misc/decimal/mfbt-abi-markers.patch
--- a/mfbt/decimal/mfbt-abi-markers.patch
+++ b/mozglue/misc/decimal/mfbt-abi-markers.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/decimal/Decimal.h b/mfbt/decimal/Decimal.h
---- a/mfbt/decimal/Decimal.h
-+++ b/mfbt/decimal/Decimal.h
+diff --git a/mozglue/misc/decimal/Decimal.h b/mozglue/misc/decimal/Decimal.h
+--- a/mozglue/misc/decimal/Decimal.h
++++ b/mozglue/misc/decimal/Decimal.h
 @@ -26,16 +26,18 @@
   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
  #ifndef Decimal_h
  #define Decimal_h
rename from mfbt/decimal/moz-decimal-utils.h
rename to mozglue/misc/decimal/moz-decimal-utils.h
rename from mfbt/decimal/to-moz-dependencies.patch
rename to mozglue/misc/decimal/to-moz-dependencies.patch
--- a/mfbt/decimal/to-moz-dependencies.patch
+++ b/mozglue/misc/decimal/to-moz-dependencies.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp
---- a/mfbt/decimal/Decimal.cpp
-+++ b/mfbt/decimal/Decimal.cpp
+diff --git a/mozglue/misc/decimal/Decimal.cpp b/mozglue/misc/decimal/Decimal.cpp
+--- a/mozglue/misc/decimal/Decimal.cpp
++++ b/mozglue/misc/decimal/Decimal.cpp
 @@ -23,22 +23,20 @@
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
@@ -107,19 +107,19 @@ diff --git a/mfbt/decimal/Decimal.cpp b/
 +}
 +
  Decimal Decimal::zero(Sign sign)
  {
      return Decimal(EncodedData(sign, EncodedData::ClassZero));
  }
  
  } // namespace blink
-diff --git a/mfbt/decimal/Decimal.h b/mfbt/decimal/Decimal.h
---- a/mfbt/decimal/Decimal.h
-+++ b/mfbt/decimal/Decimal.h
+diff --git a/mozglue/misc/decimal/Decimal.h b/mozglue/misc/decimal/Decimal.h
+--- a/mozglue/misc/decimal/Decimal.h
++++ b/mozglue/misc/decimal/Decimal.h
 @@ -23,26 +23,49 @@
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
   * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
rename from mfbt/decimal/update.sh
rename to mozglue/misc/decimal/update.sh
rename from mfbt/decimal/zero-serialization.patch
rename to mozglue/misc/decimal/zero-serialization.patch
--- a/mfbt/decimal/zero-serialization.patch
+++ b/mozglue/misc/decimal/zero-serialization.patch
@@ -1,11 +1,11 @@
-diff --git a/mfbt/decimal/Decimal.cpp b/mfbt/decimal/Decimal.cpp
---- a/mfbt/decimal/Decimal.cpp
-+++ b/mfbt/decimal/Decimal.cpp
+diff --git a/mozglue/misc/decimal/Decimal.cpp b/mozglue/misc/decimal/Decimal.cpp
+--- a/mozglue/misc/decimal/Decimal.cpp
++++ b/mozglue/misc/decimal/Decimal.cpp
 @@ -277,17 +277,17 @@ bool Decimal::EncodedData::operator==(co
  }
  
  Decimal::Decimal(int32_t i32)
      : m_data(i32 < 0 ? Negative : Positive, 0, i32 < 0 ? static_cast<uint64_t>(-static_cast<int64_t>(i32)) : static_cast<uint64_t>(i32))
  {
  }
  
--- a/mozglue/misc/moz.build
+++ b/mozglue/misc/moz.build
@@ -3,16 +3,17 @@
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 FINAL_LIBRARY = 'mozglue'
 
 EXPORTS.mozilla += [
     'AutoProfilerLabel.h',
+    'decimal/Decimal.h',
     'PlatformConditionVariable.h',
     'PlatformMutex.h',
     'Printf.h',
     'StackWalk.h',
     'TimeStamp.h',
 ]
 
 EXPORTS.mozilla.glue += [
@@ -72,8 +73,16 @@ if CONFIG['OS_ARCH'] == 'WINNT':
         'ConditionVariable_windows.cpp',
         'Mutex_windows.cpp',
     ]
 else:
     SOURCES += [
         'ConditionVariable_posix.cpp',
         'Mutex_posix.cpp',
     ]
+
+SOURCES += [
+    'decimal/Decimal.cpp',
+]
+
+if CONFIG['CC_TYPE'] == 'clang':
+    # Suppress warnings from third-party V8 Decimal code.
+    SOURCES['decimal/Decimal.cpp'].flags += ['-Wno-implicit-fallthrough']
--- a/tools/rewriting/ThirdPartyPaths.txt
+++ b/tools/rewriting/ThirdPartyPaths.txt
@@ -75,27 +75,27 @@ media/libvorbis/
 media/libvpx/
 media/libwebp/
 media/libyuv/
 media/mtransport/third_party/
 media/openmax_dl/
 media/openmax_il/
 media/webrtc/signaling/src/sdp/sipcc/
 media/webrtc/trunk/
-mfbt/decimal/
 mfbt/double-conversion/double-conversion/
 mfbt/lz4.*
 mobile/android/geckoview/src/thirdparty/
 mobile/android/thirdparty/
 modules/brotli/
 modules/fdlibm/
 modules/freetype2/
 modules/woff2/
 modules/xz-embedded/
 modules/zlib/
+mozglue/misc/decimal/
 netwerk/dns/nsIDNKitInterface.h
 netwerk/sctp/src/
 netwerk/srtp/src/
 nsprpub/
 other-licenses/
 parser/expat/
 security/nss/
 security/sandbox/chromium/