Bug 1447442 - Part 11: Use MOZ_IS_GCC to test for GCC. r=Waldo
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 13 Apr 2018 02:26:01 -0700
changeset 466872 109933956ea91fad2b5722c2161715cb408b3178
parent 466871 8bae4384ab4c8824ae137685023a5c35fb7032b6
child 466873 2b300e277494b2aa2ed79d36118f4aa4b84e328e
push id9165
push userasasaki@mozilla.com
push dateThu, 26 Apr 2018 21:04:54 +0000
treeherdermozilla-beta@064c3804de2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1447442
milestone61.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 1447442 - Part 11: Use MOZ_IS_GCC to test for GCC. r=Waldo
js/public/Conversions.h
js/src/vm/TypedArrayObject-inl.h
--- a/js/public/Conversions.h
+++ b/js/public/Conversions.h
@@ -5,16 +5,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* ECMAScript conversion operations. */
 
 #ifndef js_Conversions_h
 #define js_Conversions_h
 
 #include "mozilla/Casting.h"
+#include "mozilla/Compiler.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/MathAlgorithms.h"
 #include "mozilla/TypeTraits.h"
 #include "mozilla/WrappingOperations.h"
 
 #include <math.h>
 
 #include "jspubtd.h"
@@ -393,17 +394,17 @@ ToIntWidth(double d)
 } // namespace detail
 
 /* ES5 9.5 ToInt32 (specialized for doubles). */
 inline int32_t
 ToInt32(double d)
 {
     // clang crashes compiling this when targeting arm:
     // https://llvm.org/bugs/show_bug.cgi?id=22974
-#if defined (__arm__) && defined (__GNUC__) && !defined(__clang__)
+#if defined (__arm__) && MOZ_IS_GCC
     int32_t i;
     uint32_t    tmp0;
     uint32_t    tmp1;
     uint32_t    tmp2;
     asm (
     // We use a pure integer solution here. In the 'softfp' ABI, the argument
     // will start in r0 and r1, and VFP can't do all of the necessary ECMA
     // conversions by itself so some integer code will be required anyway. A
--- a/js/src/vm/TypedArrayObject-inl.h
+++ b/js/src/vm/TypedArrayObject-inl.h
@@ -7,16 +7,17 @@
 #ifndef vm_TypedArrayObject_inl_h
 #define vm_TypedArrayObject_inl_h
 
 /* Utilities and common inline code for TypedArray */
 
 #include "vm/TypedArrayObject.h"
 
 #include "mozilla/Assertions.h"
+#include "mozilla/Compiler.h"
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/PodOperations.h"
 
 #include "jsnum.h"
 
 #include "builtin/Array.h"
 #include "gc/Zone.h"
 #include "jit/AtomicOperations.h"
@@ -259,17 +260,17 @@ class ElementSpecific
         uint32_t count = source->length();
 
         if (source->type() == target->type()) {
             Ops::podCopy(dest, source->viewDataEither().template cast<T*>(), count);
             return true;
         }
 
         // Inhibit unaligned accesses on ARM (bug 1097253, a compiler bug).
-#if defined(__arm__) && defined(__GNUC__) && !defined(__clang__)
+#if defined(__arm__) && MOZ_IS_GCC
 #  define JS_VOLATILE_ARM volatile
 #else
 #  define JS_VOLATILE_ARM
 #endif
 
         SharedMem<void*> data = Ops::extract(source);
         switch (source->type()) {
           case Scalar::Int8: {