Blob Blame History Raw
From 844246bd10971ec348f044bc7a13acb17b9ce033 Mon Sep 17 00:00:00 2001
From: Helio Chissini de Castro <helio@kde.org>
Date: Wed, 31 May 2017 14:38:20 +0200
Subject: [PATCH] qtwebengine-opensource-src-5.9.0-no-sse2

---
 .../chromium/breakpad/src/build/common.gypi        |    8 +-
 src/3rdparty/chromium/cc/BUILD.gn                  |   39 +-
 src/3rdparty/chromium/media/BUILD.gn               |   20 +
 src/3rdparty/chromium/media/base/BUILD.gn          |   48 +-
 src/3rdparty/chromium/media/base/media.cc          |    4 +
 .../chromium/media/base/simd/convert_yuv_to_rgb.h  |   34 +
 .../media/base/simd/convert_yuv_to_rgb_mmx.asm     |   24 +
 .../media/base/simd/convert_yuv_to_rgb_x86.cc      |   56 +
 src/3rdparty/chromium/media/base/simd/filter_yuv.h |    6 +
 .../chromium/media/base/simd/filter_yuv_mmx.cc     |   79 +
 .../chromium/media/base/simd/sinc_resampler_sse.cc |   50 +
 .../chromium/media/base/simd/vector_math_sse.cc    |  118 +
 src/3rdparty/chromium/media/base/sinc_resampler.cc |   81 +-
 src/3rdparty/chromium/media/base/sinc_resampler.h  |    4 +
 .../chromium/media/base/sinc_resampler_perftest.cc |    4 +
 .../chromium/media/base/sinc_resampler_unittest.cc |    5 +
 src/3rdparty/chromium/media/base/vector_math.cc    |  150 +-
 src/3rdparty/chromium/media/base/vector_math.h     |    5 +
 .../chromium/media/base/vector_math_perftest.cc    |   35 +-
 .../chromium/media/base/vector_math_testing.h      |    2 +-
 .../chromium/media/base/vector_math_unittest.cc    |    4 +
 src/3rdparty/chromium/media/base/yuv_convert.cc    |   50 +-
 .../chromium/media/base/yuv_convert_perftest.cc    |   79 +-
 .../chromium/media/base/yuv_convert_unittest.cc    |  159 +-
 src/3rdparty/chromium/skia/BUILD.gn                |   52 +-
 src/3rdparty/chromium/skia/ext/convolver.cc        |   11 +-
 src/3rdparty/chromium/skia/ext/convolver.h         |    1 +
 .../Source/modules/webaudio/AudioParamTimeline.cpp |    8 +-
 .../Source/platform/audio/DirectConvolver.cpp      |   40 +-
 .../WebKit/Source/platform/audio/DirectConvolver.h |    7 +
 .../WebKit/Source/platform/audio/SincResampler.cpp |   31 +-
 .../WebKit/Source/platform/audio/SincResampler.h   |    7 +
 .../WebKit/Source/platform/audio/VectorMath.cpp    |   97 +-
 .../WebKit/Source/platform/audio/VectorMath.h      |   23 +
 .../graphics/cpu/x86/WebGLImageConversionSSE.h     |    2 +-
 .../platform/graphics/gpu/WebGLImageConversion.cpp |   12 +-
 src/3rdparty/chromium/third_party/qcms/BUILD.gn    |   17 +-
 .../webrtc/common_audio/real_fourier.cc            |    9 +
 src/3rdparty/chromium/v8/BUILD.gn                  |   72 +-
 src/3rdparty/chromium/v8/src/make-v8-sse2-gyp.sh   |   56 +
 src/3rdparty/chromium/v8/src/v8.gyp                |   12 +-
 src/3rdparty/chromium/v8/src/v8_sse2.gyp           | 2313 ++++++++++++++++++++
 src/core/core_module.pro                           |   30 +-
 43 files changed, 3537 insertions(+), 327 deletions(-)
 create mode 100644 src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm
 create mode 100644 src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc
 create mode 100644 src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc
 create mode 100644 src/3rdparty/chromium/media/base/simd/vector_math_sse.cc
 create mode 100644 src/3rdparty/chromium/v8/src/make-v8-sse2-gyp.sh
 create mode 100644 src/3rdparty/chromium/v8/src/v8_sse2.gyp

diff --git a/src/3rdparty/chromium/breakpad/src/build/common.gypi b/src/3rdparty/chromium/breakpad/src/build/common.gypi
index b9466a325..8ad78e24f 100644
--- a/src/3rdparty/chromium/breakpad/src/build/common.gypi
+++ b/src/3rdparty/chromium/breakpad/src/build/common.gypi
@@ -80,8 +80,8 @@
       # The system root for cross-compiles. Default: none.
       'sysroot%': '',
 
-      # On Linux, we build with sse2 for Chromium builds.
-      'disable_sse2%': 0,
+      # Do not assume SSE2 by default (Fedora patch).
+      'disable_sse2%': 1,
     },
 
     'target_arch%': '<(target_arch)',
@@ -725,17 +725,13 @@
             'conditions': [
               ['disable_sse2==0', {
                 'cflags': [
-                  '-march=pentium4',
                   '-msse2',
                   '-mfpmath=sse',
                 ],
               }],
             ],
-            # -mmmx allows mmintrin.h to be used for mmx intrinsics.
-            # video playback is mmx and sse2 optimized.
             'cflags': [
               '-m32',
-              '-mmmx',
             ],
             'ldflags': [
               '-m32',
diff --git a/src/3rdparty/chromium/cc/BUILD.gn b/src/3rdparty/chromium/cc/BUILD.gn
index e461a898d..b50659b89 100644
--- a/src/3rdparty/chromium/cc/BUILD.gn
+++ b/src/3rdparty/chromium/cc/BUILD.gn
@@ -567,13 +567,6 @@ component("cc") {
     "trees/tree_synchronizer.h",
   ]
 
-  if (current_cpu == "x86" || current_cpu == "x64") {
-    sources += [
-      "raster/texture_compressor_etc1_sse.cc",
-      "raster/texture_compressor_etc1_sse.h",
-    ]
-  }
-
   configs += [ "//build/config:precompiled_headers" ]
 
   public_deps = [
@@ -583,6 +576,7 @@ component("cc") {
   deps = [
     "//base",
     "//base/third_party/dynamic_annotations",
+    "//cc:cc_opts",
     "//cc/proto",
     "//cc/surfaces:surface_id",
     "//gpu",
@@ -612,6 +606,37 @@ component("cc") {
   }
 }
 
+source_set("cc_opts") {
+  public_deps = [
+    "//cc:cc_opts_sse",
+  ]
+}
+
+source_set("cc_opts_sse") {
+  if (current_cpu == "x86" || current_cpu == "x64") {
+    deps = [
+      "//base",
+    ]
+
+    defines = [ "CC_IMPLEMENTATION=1" ]
+
+    if (!is_debug && (is_win || is_android)) {
+      configs -= [ "//build/config/compiler:optimize" ]
+      configs += [ "//build/config/compiler:optimize_max" ]
+    }
+
+    sources = [
+      "raster/texture_compressor.h",
+      "raster/texture_compressor_etc1.h",
+      "raster/texture_compressor_etc1_sse.cc",
+      "raster/texture_compressor_etc1_sse.h",
+    ]
+
+    cflags = [ "-msse2" ]
+  }
+}
+
+
 static_library("test_support") {
   testonly = true
   sources = [
diff --git a/src/3rdparty/chromium/media/BUILD.gn b/src/3rdparty/chromium/media/BUILD.gn
index 652aad4d9..063254830 100644
--- a/src/3rdparty/chromium/media/BUILD.gn
+++ b/src/3rdparty/chromium/media/BUILD.gn
@@ -832,6 +832,26 @@ component("shared_memory_support") {
     "//base",
     "//ui/gfx/geometry",
   ]
+  if (current_cpu == "x86" || current_cpu == "x64") {
+    deps += [
+      ":shared_memory_support_sse",
+    ]
+  }
+}
+
+if (current_cpu == "x86" || current_cpu == "x64") {
+  source_set("shared_memory_support_sse") {
+    sources = [
+      "base/simd/vector_math_sse.cc",
+    ]
+    configs += [
+      "//media:media_config",
+      "//media:media_implementation",
+    ]
+    if (!is_win) {
+      cflags = [ "-msse" ]
+    }
+  }
 }
 
 # TODO(watk): Refactor tests that could be made to run on Android. See
diff --git a/src/3rdparty/chromium/media/base/BUILD.gn b/src/3rdparty/chromium/media/base/BUILD.gn
index d288ec787..fac712c00 100644
--- a/src/3rdparty/chromium/media/base/BUILD.gn
+++ b/src/3rdparty/chromium/media/base/BUILD.gn
@@ -336,11 +336,12 @@ target(link_target_type, "base") {
   }
 
   if (current_cpu == "x86" || current_cpu == "x64") {
-    sources += [
-      "simd/convert_rgb_to_yuv_sse2.cc",
-      "simd/convert_rgb_to_yuv_ssse3.cc",
-      "simd/convert_yuv_to_rgb_x86.cc",
-      "simd/filter_yuv_sse2.cc",
+    sources += [ "simd/convert_yuv_to_rgb_x86.cc" ]
+    deps += [
+      ":media_yasm",
+      ":media_mmx",
+      ":media_sse",
+      ":media_sse2",
     ]
     deps += [ ":media_yasm" ]
   }
@@ -539,10 +540,47 @@ source_set("perftests") {
 }
 
 if (current_cpu == "x86" || current_cpu == "x64") {
+  source_set("media_mmx") {
+    sources = [ "simd/filter_yuv_mmx.cc" ]
+    configs += [ "//media:media_config" ]
+    if (!is_win) {
+      cflags = [ "-mmmx" ]
+    }
+  }
+
+  source_set("media_sse") {
+    sources = [
+      "simd/sinc_resampler_sse.cc",
+    ]
+    configs += [
+      "//media:media_config",
+      "//media:media_implementation",
+    ]
+    if (!is_win) {
+      cflags = [ "-msse" ]
+    }
+  }
+
+  source_set("media_sse2") {
+    sources = [
+      "simd/convert_rgb_to_yuv_sse2.cc",
+      "simd/convert_rgb_to_yuv_ssse3.cc",
+      "simd/filter_yuv_sse2.cc",
+    ]
+    configs += [
+      "//media:media_config",
+      "//media:media_implementation",
+    ]
+    if (!is_win) {
+      cflags = [ "-msse2" ]
+    }
+  }
+
   import("//third_party/yasm/yasm_assemble.gni")
   yasm_assemble("media_yasm") {
     sources = [
       "simd/convert_rgb_to_yuv_ssse3.asm",
+      "simd/convert_yuv_to_rgb_mmx.asm",
       "simd/convert_yuv_to_rgb_sse.asm",
       "simd/convert_yuva_to_argb_mmx.asm",
       "simd/empty_register_state_mmx.asm",
diff --git a/src/3rdparty/chromium/media/base/media.cc b/src/3rdparty/chromium/media/base/media.cc
index 38daf05b8..bb43b405f 100644
--- a/src/3rdparty/chromium/media/base/media.cc
+++ b/src/3rdparty/chromium/media/base/media.cc
@@ -10,6 +10,8 @@
 #include "base/metrics/field_trial.h"
 #include "base/trace_event/trace_event.h"
 #include "media/base/media_switches.h"
+#include "media/base/sinc_resampler.h"
+#include "media/base/vector_math.h"
 #include "media/base/yuv_convert.h"
 
 #if defined(OS_ANDROID)
@@ -40,6 +42,8 @@ class MediaInitializer {
     TRACE_EVENT_WARMUP_CATEGORY("media");
 
     // Perform initialization of libraries which require runtime CPU detection.
+    vector_math::Initialize();
+    SincResampler::InitializeCPUSpecificFeatures();
     InitializeCPUSpecificYUVConversions();
 
 #if !defined(MEDIA_DISABLE_FFMPEG)
diff --git a/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h b/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h
index a421ff566..8373fde90 100644
--- a/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h
+++ b/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb.h
@@ -65,6 +65,17 @@ MEDIA_EXPORT void ConvertYUVToRGB32_SSE(const uint8_t* yplane,
                                         int rgbstride,
                                         YUVType yuv_type);
 
+MEDIA_EXPORT void ConvertYUVToRGB32_MMX(const uint8_t* yplane,
+                                        const uint8_t* uplane,
+                                        const uint8_t* vplane,
+                                        uint8_t* rgbframe,
+                                        int width,
+                                        int height,
+                                        int ystride,
+                                        int uvstride,
+                                        int rgbstride,
+                                        YUVType yuv_type);
+
 MEDIA_EXPORT void ConvertYUVAToARGB_MMX(const uint8_t* yplane,
                                         const uint8_t* uplane,
                                         const uint8_t* vplane,
@@ -86,6 +97,13 @@ MEDIA_EXPORT void ScaleYUVToRGB32Row_C(const uint8_t* y_buf,
                                        ptrdiff_t source_dx,
                                        const int16_t* convert_table);
 
+MEDIA_EXPORT void ConvertYUVToRGB32Row_MMX(const uint8_t* yplane,
+                                           const uint8_t* uplane,
+                                           const uint8_t* vplane,
+                                           uint8_t* rgbframe,
+                                           ptrdiff_t width,
+                                           const int16_t* convert_table);
+
 MEDIA_EXPORT void LinearScaleYUVToRGB32Row_C(const uint8_t* y_buf,
                                              const uint8_t* u_buf,
                                              const uint8_t* v_buf,
@@ -94,6 +112,14 @@ MEDIA_EXPORT void LinearScaleYUVToRGB32Row_C(const uint8_t* y_buf,
                                              ptrdiff_t source_dx,
                                              const int16_t* convert_table);
 
+MEDIA_EXPORT void ScaleYUVToRGB32Row_MMX(const uint8_t* y_buf,
+                                         const uint8_t* u_buf,
+                                         const uint8_t* v_buf,
+                                         uint8_t* rgb_buf,
+                                         ptrdiff_t width,
+                                         ptrdiff_t source_dx,
+                                         const int16_t* convert_table);
+
 MEDIA_EXPORT void LinearScaleYUVToRGB32RowWithRange_C(
     const uint8_t* y_buf,
     const uint8_t* u_buf,
@@ -104,6 +130,14 @@ MEDIA_EXPORT void LinearScaleYUVToRGB32RowWithRange_C(
     int source_dx,
     const int16_t* convert_table);
 
+MEDIA_EXPORT void LinearScaleYUVToRGB32Row_MMX(const uint8_t* y_buf,
+                                               const uint8_t* u_buf,
+                                               const uint8_t* v_buf,
+                                               uint8_t* rgb_buf,
+                                               ptrdiff_t width,
+                                               ptrdiff_t source_dx,
+                                               const int16_t* convert_table);
+
 }  // namespace media
 
 // Assembly functions are declared without namespace.
diff --git a/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm b/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm
new file mode 100644
index 000000000..3650c9f73
--- /dev/null
+++ b/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_mmx.asm
@@ -0,0 +1,24 @@
+; Copyright (c) 2011 The Chromium Authors. All rights reserved.
+; Use of this source code is governed by a BSD-style license that can be
+; found in the LICENSE file.
+
+%include "third_party/x86inc/x86inc.asm"
+
+;
+; This file uses MMX instructions.
+;
+  SECTION_TEXT
+  CPU       MMX
+
+; Use movq to save the output.
+%define MOVQ movq
+
+; extern "C" void ConvertYUVToRGB32Row_MMX(const uint8* y_buf,
+;                                          const uint8* u_buf,
+;                                          const uint8* v_buf,
+;                                          uint8* rgb_buf,
+;                                          ptrdiff_t width,
+;                                          const int16* convert_table);
+%define SYMBOL ConvertYUVToRGB32Row_MMX
+%include "convert_yuv_to_rgb_mmx.inc"
+
diff --git a/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc b/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc
index a06799bfd..819bb60a8 100644
--- a/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc
+++ b/src/3rdparty/chromium/media/base/simd/convert_yuv_to_rgb_x86.cc
@@ -47,6 +47,62 @@ void ConvertYUVAToARGB_MMX(const uint8_t* yplane,
   EmptyRegisterState();
 }
 
+void ConvertYUVToRGB32_MMX(const uint8_t* yplane,
+                           const uint8_t* uplane,
+                           const uint8_t* vplane,
+                           uint8_t* rgbframe,
+                           int width,
+                           int height,
+                           int ystride,
+                           int uvstride,
+                           int rgbstride,
+                           YUVType yuv_type) {
+  unsigned int y_shift = GetVerticalShift(yuv_type);
+  for (int y = 0; y < height; ++y) {
+    uint8_t* rgb_row = rgbframe + y * rgbstride;
+    const uint8_t* y_ptr = yplane + y * ystride;
+    const uint8_t* u_ptr = uplane + (y >> y_shift) * uvstride;
+    const uint8_t* v_ptr = vplane + (y >> y_shift) * uvstride;
+
+    ConvertYUVToRGB32Row_MMX(y_ptr,
+                             u_ptr,
+                             v_ptr,
+                             rgb_row,
+                             width,
+                             GetLookupTable(yuv_type));
+  }
+
+  EmptyRegisterState();
+}
+
+void ConvertYUVToRGB32_MMX(const uint8_t* yplane,
+                           const uint8_t* uplane,
+                           const uint8_t* vplane,
+                           uint8_t* rgbframe,
+                           int width,
+                           int height,
+                           int ystride,
+                           int uvstride,
+                           int rgbstride,
+                           YUVType yuv_type) {
+  unsigned int y_shift = GetVerticalShift(yuv_type);
+  for (int y = 0; y < height; ++y) {
+    uint8_t* rgb_row = rgbframe + y * rgbstride;
+    const uint8_t* y_ptr = yplane + y * ystride;
+    const uint8_t* u_ptr = uplane + (y >> y_shift) * uvstride;
+    const uint8_t* v_ptr = vplane + (y >> y_shift) * uvstride;
+
+    ConvertYUVToRGB32Row_MMX(y_ptr,
+                             u_ptr,
+                             v_ptr,
+                             rgb_row,
+                             width,
+                             GetLookupTable(yuv_type));
+  }
+
+  EmptyRegisterState();
+}
+
 void ConvertYUVToRGB32_SSE(const uint8_t* yplane,
                            const uint8_t* uplane,
                            const uint8_t* vplane,
diff --git a/src/3rdparty/chromium/media/base/simd/filter_yuv.h b/src/3rdparty/chromium/media/base/simd/filter_yuv.h
index af30bd133..206fb7f11 100644
--- a/src/3rdparty/chromium/media/base/simd/filter_yuv.h
+++ b/src/3rdparty/chromium/media/base/simd/filter_yuv.h
@@ -20,6 +20,12 @@ MEDIA_EXPORT void FilterYUVRows_C(uint8_t* ybuf,
                                   int source_width,
                                   uint8_t source_y_fraction);
 
+MEDIA_EXPORT void FilterYUVRows_MMX(uint8_t* ybuf,
+                                    const uint8_t* y0_ptr,
+                                    const uint8_t* y1_ptr,
+                                    int source_width,
+                                    uint8_t source_y_fraction);
+
 MEDIA_EXPORT void FilterYUVRows_SSE2(uint8_t* ybuf,
                                      const uint8_t* y0_ptr,
                                      const uint8_t* y1_ptr,
diff --git a/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc b/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc
new file mode 100644
index 000000000..416aca699
--- /dev/null
+++ b/src/3rdparty/chromium/media/base/simd/filter_yuv_mmx.cc
@@ -0,0 +1,79 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#if defined(_MSC_VER)
+#include <intrin.h>
+#else
+#include <mmintrin.h>
+#endif
+
+#include "build/build_config.h"
+#include "media/base/simd/filter_yuv.h"
+
+namespace media {
+
+#if defined(COMPILER_MSVC)
+// Warning 4799 is about calling emms before the function exits.
+// We calls emms in a frame level so suppress this warning.
+#pragma warning(push)
+#pragma warning(disable: 4799)
+#endif
+
+void FilterYUVRows_MMX(uint8_t* dest,
+                       const uint8_t* src0,
+                       const uint8_t* src1,
+                       int width,
+                       uint8_t fraction) {
+  int pixel = 0;
+
+  // Process the unaligned bytes first.
+  int unaligned_width =
+      (8 - (reinterpret_cast<uintptr_t>(dest) & 7)) & 7;
+  while (pixel < width && pixel < unaligned_width) {
+    dest[pixel] = (src0[pixel] * (256 - fraction) +
+                   src1[pixel] * fraction) >> 8;
+    ++pixel;
+  }
+
+  __m64 zero = _mm_setzero_si64();
+  __m64 src1_fraction = _mm_set1_pi16(fraction);
+  __m64 src0_fraction = _mm_set1_pi16(256 - fraction);
+  const __m64* src0_64 = reinterpret_cast<const __m64*>(src0 + pixel);
+  const __m64* src1_64 = reinterpret_cast<const __m64*>(src1 + pixel);
+  __m64* dest64 = reinterpret_cast<__m64*>(dest + pixel);
+  __m64* end64 = reinterpret_cast<__m64*>(
+      reinterpret_cast<uintptr_t>(dest + width) & ~7);
+
+  while (dest64 < end64) {
+    __m64 src0 = *src0_64++;
+    __m64 src1 = *src1_64++;
+    __m64 src2 = _mm_unpackhi_pi8(src0, zero);
+    __m64 src3 = _mm_unpackhi_pi8(src1, zero);
+    src0 = _mm_unpacklo_pi8(src0, zero);
+    src1 = _mm_unpacklo_pi8(src1, zero);
+    src0 = _mm_mullo_pi16(src0, src0_fraction);
+    src1 = _mm_mullo_pi16(src1, src1_fraction);
+    src2 = _mm_mullo_pi16(src2, src0_fraction);
+    src3 = _mm_mullo_pi16(src3, src1_fraction);
+    src0 = _mm_add_pi16(src0, src1);
+    src2 = _mm_add_pi16(src2, src3);
+    src0 = _mm_srli_pi16(src0, 8);
+    src2 = _mm_srli_pi16(src2, 8);
+    src0 = _mm_packs_pu16(src0, src2);
+    *dest64++ = src0;
+    pixel += 8;
+  }
+
+  while (pixel < width) {
+    dest[pixel] = (src0[pixel] * (256 - fraction) +
+                   src1[pixel] * fraction) >> 8;
+    ++pixel;
+  }
+}
+
+#if defined(COMPILER_MSVC)
+#pragma warning(pop)
+#endif
+
+}  // namespace media
diff --git a/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc b/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc
new file mode 100644
index 000000000..c5d03dc48
--- /dev/null
+++ b/src/3rdparty/chromium/media/base/simd/sinc_resampler_sse.cc
@@ -0,0 +1,50 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/base/sinc_resampler.h"
+
+#include <xmmintrin.h>
+
+namespace media {
+
+float SincResampler::Convolve_SSE(const float* input_ptr, const float* k1,
+                                  const float* k2,
+                                  double kernel_interpolation_factor) {
+  __m128 m_input;
+  __m128 m_sums1 = _mm_setzero_ps();
+  __m128 m_sums2 = _mm_setzero_ps();
+
+  // Based on |input_ptr| alignment, we need to use loadu or load.  Unrolling
+  // these loops hurt performance in local testing.
+  if (reinterpret_cast<uintptr_t>(input_ptr) & 0x0F) {
+    for (int i = 0; i < kKernelSize; i += 4) {
+      m_input = _mm_loadu_ps(input_ptr + i);
+      m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i)));
+      m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i)));
+    }
+  } else {
+    for (int i = 0; i < kKernelSize; i += 4) {
+      m_input = _mm_load_ps(input_ptr + i);
+      m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i)));
+      m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i)));
+    }
+  }
+
+  // Linearly interpolate the two "convolutions".
+  m_sums1 = _mm_mul_ps(m_sums1, _mm_set_ps1(
+      static_cast<float>(1.0 - kernel_interpolation_factor)));
+  m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1(
+      static_cast<float>(kernel_interpolation_factor)));
+  m_sums1 = _mm_add_ps(m_sums1, m_sums2);
+
+  // Sum components together.
+  float result;
+  m_sums2 = _mm_add_ps(_mm_movehl_ps(m_sums1, m_sums1), m_sums1);
+  _mm_store_ss(&result, _mm_add_ss(m_sums2, _mm_shuffle_ps(
+      m_sums2, m_sums2, 1)));
+
+  return result;
+}
+
+}  // namespace media
diff --git a/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc b/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc
new file mode 100644
index 000000000..c2121225c
--- /dev/null
+++ b/src/3rdparty/chromium/media/base/simd/vector_math_sse.cc
@@ -0,0 +1,118 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/base/vector_math_testing.h"
+
+#include <algorithm>
+
+#include <xmmintrin.h>  // NOLINT
+
+namespace media {
+namespace vector_math {
+
+void FMUL_SSE(const float src[], float scale, int len, float dest[]) {
+  const int rem = len % 4;
+  const int last_index = len - rem;
+  __m128 m_scale = _mm_set_ps1(scale);
+  for (int i = 0; i < last_index; i += 4)
+    _mm_store_ps(dest + i, _mm_mul_ps(_mm_load_ps(src + i), m_scale));
+
+  // Handle any remaining values that wouldn't fit in an SSE pass.
+  for (int i = last_index; i < len; ++i)
+    dest[i] = src[i] * scale;
+}
+
+void FMAC_SSE(const float src[], float scale, int len, float dest[]) {
+  const int rem = len % 4;
+  const int last_index = len - rem;
+  __m128 m_scale = _mm_set_ps1(scale);
+  for (int i = 0; i < last_index; i += 4) {
+    _mm_store_ps(dest + i, _mm_add_ps(_mm_load_ps(dest + i),
+                 _mm_mul_ps(_mm_load_ps(src + i), m_scale)));
+  }
+
+  // Handle any remaining values that wouldn't fit in an SSE pass.
+  for (int i = last_index; i < len; ++i)
+    dest[i] += src[i] * scale;
+}
+
+// Convenience macro to extract float 0 through 3 from the vector |a|.  This is
+// needed because compilers other than clang don't support access via
+// operator[]().
+#define EXTRACT_FLOAT(a, i) \
+    (i == 0 ? \
+         _mm_cvtss_f32(a) : \
+         _mm_cvtss_f32(_mm_shuffle_ps(a, a, i)))
+
+std::pair<float, float> EWMAAndMaxPower_SSE(
+    float initial_value, const float src[], int len, float smoothing_factor) {
+  // When the recurrence is unrolled, we see that we can split it into 4
+  // separate lanes of evaluation:
+  //
+  // y[n] = a(S[n]^2) + (1-a)(y[n-1])
+  //      = a(S[n]^2) + (1-a)^1(aS[n-1]^2) + (1-a)^2(aS[n-2]^2) + ...
+  //      = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3])
+  //
+  // where z[n] = a(S[n]^2) + (1-a)^4(z[n-4]) + (1-a)^8(z[n-8]) + ...
+  //
+  // Thus, the strategy here is to compute z[n], z[n-1], z[n-2], and z[n-3] in
+  // each of the 4 lanes, and then combine them to give y[n].
+
+  const int rem = len % 4;
+  const int last_index = len - rem;
+
+  const __m128 smoothing_factor_x4 = _mm_set_ps1(smoothing_factor);
+  const float weight_prev = 1.0f - smoothing_factor;
+  const __m128 weight_prev_x4 = _mm_set_ps1(weight_prev);
+  const __m128 weight_prev_squared_x4 =
+      _mm_mul_ps(weight_prev_x4, weight_prev_x4);
+  const __m128 weight_prev_4th_x4 =
+      _mm_mul_ps(weight_prev_squared_x4, weight_prev_squared_x4);
+
+  // Compute z[n], z[n-1], z[n-2], and z[n-3] in parallel in lanes 3, 2, 1 and
+  // 0, respectively.
+  __m128 max_x4 = _mm_setzero_ps();
+  __m128 ewma_x4 = _mm_setr_ps(0.0f, 0.0f, 0.0f, initial_value);
+  int i;
+  for (i = 0; i < last_index; i += 4) {
+    ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_4th_x4);
+    const __m128 sample_x4 = _mm_load_ps(src + i);
+    const __m128 sample_squared_x4 = _mm_mul_ps(sample_x4, sample_x4);
+    max_x4 = _mm_max_ps(max_x4, sample_squared_x4);
+    // Note: The compiler optimizes this to a single multiply-and-accumulate
+    // instruction:
+    ewma_x4 = _mm_add_ps(ewma_x4,
+                         _mm_mul_ps(sample_squared_x4, smoothing_factor_x4));
+  }
+
+  // y[n] = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3])
+  float ewma = EXTRACT_FLOAT(ewma_x4, 3);
+  ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4);
+  ewma += EXTRACT_FLOAT(ewma_x4, 2);
+  ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4);
+  ewma += EXTRACT_FLOAT(ewma_x4, 1);
+  ewma_x4 = _mm_mul_ss(ewma_x4, weight_prev_x4);
+  ewma += EXTRACT_FLOAT(ewma_x4, 0);
+
+  // Fold the maximums together to get the overall maximum.
+  max_x4 = _mm_max_ps(max_x4,
+                      _mm_shuffle_ps(max_x4, max_x4, _MM_SHUFFLE(3, 3, 1, 1)));
+  max_x4 = _mm_max_ss(max_x4, _mm_shuffle_ps(max_x4, max_x4, 2));
+
+  std::pair<float, float> result(ewma, EXTRACT_FLOAT(max_x4, 0));
+
+  // Handle remaining values at the end of |src|.
+  for (; i < len; ++i) {
+    result.first *= weight_prev;
+    const float sample = src[i];
+    const float sample_squared = sample * sample;
+    result.first += sample_squared * smoothing_factor;
+    result.second = std::max(result.second, sample_squared);
+  }
+
+  return result;
+}
+
+}  // namespace vector_math
+}  // namespace media
diff --git a/src/3rdparty/chromium/media/base/sinc_resampler.cc b/src/3rdparty/chromium/media/base/sinc_resampler.cc
index cffb0c9d6..010775544 100644
--- a/src/3rdparty/chromium/media/base/sinc_resampler.cc
+++ b/src/3rdparty/chromium/media/base/sinc_resampler.cc
@@ -81,17 +81,12 @@
 #include <cmath>
 #include <limits>
 
+#include "base/cpu.h"
 #include "base/logging.h"
 #include "build/build_config.h"
 
-#if defined(ARCH_CPU_X86_FAMILY)
-#include <xmmintrin.h>
-#define CONVOLVE_FUNC Convolve_SSE
-#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+#if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
 #include <arm_neon.h>
-#define CONVOLVE_FUNC Convolve_NEON
-#else
-#define CONVOLVE_FUNC Convolve_C
 #endif
 
 namespace media {
@@ -112,10 +107,41 @@ static double SincScaleFactor(double io_ratio) {
   return sinc_scale_factor;
 }
 
+#undef CONVOLVE_FUNC
+
 static int CalculateChunkSize(int block_size_, double io_ratio) {
   return block_size_ / io_ratio;
 }
 
+// If we know the minimum architecture at compile time, avoid CPU detection.
+// Force NaCl code to use C routines since (at present) nothing there uses these
+// methods and plumbing the -msse built library is non-trivial.
+#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL)
+#if defined(__SSE__)
+#define CONVOLVE_FUNC Convolve_SSE
+void SincResampler::InitializeCPUSpecificFeatures() {}
+#else
+// X86 CPU detection required.  Functions will be set by
+// InitializeCPUSpecificFeatures().
+#define CONVOLVE_FUNC g_convolve_proc_
+
+typedef float (*ConvolveProc)(const float*, const float*, const float*, double);
+static ConvolveProc g_convolve_proc_ = NULL;
+
+void SincResampler::InitializeCPUSpecificFeatures() {
+  CHECK(!g_convolve_proc_);
+  g_convolve_proc_ = base::CPU().has_sse() ? Convolve_SSE : Convolve_C;
+}
+#endif
+#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+#define CONVOLVE_FUNC Convolve_NEON
+void SincResampler::InitializeCPUSpecificFeatures() {}
+#else
+// Unknown architecture.
+#define CONVOLVE_FUNC Convolve_C
+void SincResampler::InitializeCPUSpecificFeatures() {}
+#endif
+
 SincResampler::SincResampler(double io_sample_rate_ratio,
                              int request_frames,
                              const ReadCB& read_cb)
@@ -328,46 +354,7 @@ float SincResampler::Convolve_C(const float* input_ptr, const float* k1,
       kernel_interpolation_factor * sum2);
 }
 
-#if defined(ARCH_CPU_X86_FAMILY)
-float SincResampler::Convolve_SSE(const float* input_ptr, const float* k1,
-                                  const float* k2,
-                                  double kernel_interpolation_factor) {
-  __m128 m_input;
-  __m128 m_sums1 = _mm_setzero_ps();
-  __m128 m_sums2 = _mm_setzero_ps();
-
-  // Based on |input_ptr| alignment, we need to use loadu or load.  Unrolling
-  // these loops hurt performance in local testing.
-  if (reinterpret_cast<uintptr_t>(input_ptr) & 0x0F) {
-    for (int i = 0; i < kKernelSize; i += 4) {
-      m_input = _mm_loadu_ps(input_ptr + i);
-      m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i)));
-      m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i)));
-    }
-  } else {
-    for (int i = 0; i < kKernelSize; i += 4) {
-      m_input = _mm_load_ps(input_ptr + i);
-      m_sums1 = _mm_add_ps(m_sums1, _mm_mul_ps(m_input, _mm_load_ps(k1 + i)));
-      m_sums2 = _mm_add_ps(m_sums2, _mm_mul_ps(m_input, _mm_load_ps(k2 + i)));
-    }
-  }
-
-  // Linearly interpolate the two "convolutions".
-  m_sums1 = _mm_mul_ps(m_sums1, _mm_set_ps1(
-      static_cast<float>(1.0 - kernel_interpolation_factor)));
-  m_sums2 = _mm_mul_ps(m_sums2, _mm_set_ps1(
-      static_cast<float>(kernel_interpolation_factor)));
-  m_sums1 = _mm_add_ps(m_sums1, m_sums2);
-
-  // Sum components together.
-  float result;
-  m_sums2 = _mm_add_ps(_mm_movehl_ps(m_sums1, m_sums1), m_sums1);
-  _mm_store_ss(&result, _mm_add_ss(m_sums2, _mm_shuffle_ps(
-      m_sums2, m_sums2, 1)));
-
-  return result;
-}
-#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+#if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
 float SincResampler::Convolve_NEON(const float* input_ptr, const float* k1,
                                    const float* k2,
                                    double kernel_interpolation_factor) {
diff --git a/src/3rdparty/chromium/media/base/sinc_resampler.h b/src/3rdparty/chromium/media/base/sinc_resampler.h
index afbd2abc9..9e3df2c55 100644
--- a/src/3rdparty/chromium/media/base/sinc_resampler.h
+++ b/src/3rdparty/chromium/media/base/sinc_resampler.h
@@ -36,6 +36,10 @@ class MEDIA_EXPORT SincResampler {
     kKernelStorageSize = kKernelSize * (kKernelOffsetCount + 1),
   };
 
+  // Selects runtime specific CPU features like SSE.  Must be called before
+  // using SincResampler.
+  static void InitializeCPUSpecificFeatures();
+
   // Callback type for providing more data into the resampler.  Expects |frames|
   // of data to be rendered into |destination|; zero padded if not enough frames
   // are available to satisfy the request.
diff --git a/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc b/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc
index 9cb7f4f2e..285382490 100644
--- a/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc
+++ b/src/3rdparty/chromium/media/base/sinc_resampler_perftest.cc
@@ -4,6 +4,7 @@
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
+#include "base/cpu.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
 #include "media/base/sinc_resampler.h"
@@ -61,6 +62,9 @@ TEST(SincResamplerPerfTest, Convolve) {
       &resampler, SincResampler::Convolve_C, true, "unoptimized_aligned");
 
 #if defined(CONVOLVE_FUNC)
+#if defined(ARCH_CPU_X86_FAMILY)
+  ASSERT_TRUE(base::CPU().has_sse());
+#endif
   RunConvolveBenchmark(
       &resampler, SincResampler::CONVOLVE_FUNC, true, "optimized_aligned");
   RunConvolveBenchmark(
diff --git a/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc b/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc
index 8dd346ee4..7401eee96 100644
--- a/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc
+++ b/src/3rdparty/chromium/media/base/sinc_resampler_unittest.cc
@@ -10,6 +10,7 @@
 
 #include "base/bind.h"
 #include "base/bind_helpers.h"
+#include "base/cpu.h"
 #include "base/macros.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/time/time.h"
@@ -166,6 +167,10 @@ TEST(SincResamplerTest, DISABLED_SetRatioBench) {
 static const double kKernelInterpolationFactor = 0.5;
 
 TEST(SincResamplerTest, Convolve) {
+#if defined(ARCH_CPU_X86_FAMILY)
+  ASSERT_TRUE(base::CPU().has_sse());
+#endif
+
   // Initialize a dummy resampler.
   MockSource mock_source;
   SincResampler resampler(
diff --git a/src/3rdparty/chromium/media/base/vector_math.cc b/src/3rdparty/chromium/media/base/vector_math.cc
index 578290538..e041d8d4c 100644
--- a/src/3rdparty/chromium/media/base/vector_math.cc
+++ b/src/3rdparty/chromium/media/base/vector_math.cc
@@ -7,12 +7,17 @@
 
 #include <algorithm>
 
+#include "base/cpu.h"
 #include "base/logging.h"
 #include "build/build_config.h"
 
+namespace media {
+namespace vector_math {
+
+// If we know the minimum architecture at compile time, avoid CPU detection.
 // NaCl does not allow intrinsics.
 #if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL)
-#include <xmmintrin.h>
+#if defined(__SSE__)
 // Don't use custom SSE versions where the auto-vectorized C version performs
 // better, which is anywhere clang is used.
 #if !defined(__clang__)
@@ -23,20 +28,52 @@
 #define FMUL_FUNC FMUL_C
 #endif
 #define EWMAAndMaxPower_FUNC EWMAAndMaxPower_SSE
+void Initialize() {}
+#else
+// X86 CPU detection required.  Functions will be set by Initialize().
+#if !defined(__clang__)
+#define FMAC_FUNC g_fmac_proc_
+#define FMUL_FUNC g_fmul_proc_
+#else
+#define FMAC_FUNC FMAC_C
+#define FMUL_FUNC FMUL_C
+#endif
+#define EWMAAndMaxPower_FUNC g_ewma_power_proc_
+
+#if !defined(__clang__)
+typedef void (*MathProc)(const float src[], float scale, int len, float dest[]);
+static MathProc g_fmac_proc_ = NULL;
+static MathProc g_fmul_proc_ = NULL;
+#endif
+typedef std::pair<float, float> (*EWMAAndMaxPowerProc)(
+    float initial_value, const float src[], int len, float smoothing_factor);
+static EWMAAndMaxPowerProc g_ewma_power_proc_ = NULL;
+
+void Initialize() {
+  CHECK(!g_fmac_proc_);
+  CHECK(!g_fmul_proc_);
+  CHECK(!g_ewma_power_proc_);
+  const bool kUseSSE = base::CPU().has_sse();
+#if !defined(__clang__)
+  g_fmac_proc_ = kUseSSE ? FMAC_SSE : FMAC_C;
+  g_fmul_proc_ = kUseSSE ? FMUL_SSE : FMUL_C;
+#endif
+  g_ewma_power_proc_ = kUseSSE ? EWMAAndMaxPower_SSE : EWMAAndMaxPower_C;
+}
+#endif
 #elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
 #include <arm_neon.h>
 #define FMAC_FUNC FMAC_NEON
 #define FMUL_FUNC FMUL_NEON
 #define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON
+void Initialize() {}
 #else
 #define FMAC_FUNC FMAC_C
 #define FMUL_FUNC FMUL_C
 #define EWMAAndMaxPower_FUNC EWMAAndMaxPower_C
+void Initialize() {}
 #endif
 
-namespace media {
-namespace vector_math {
-
 void FMAC(const float src[], float scale, int len, float dest[]) {
   // Ensure |src| and |dest| are 16-byte aligned.
   DCHECK_EQ(0u, reinterpret_cast<uintptr_t>(src) & (kRequiredAlignment - 1));
@@ -89,111 +126,6 @@ std::pair<float, float> EWMAAndMaxPower_C(
   return result;
 }
 
-#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL)
-void FMUL_SSE(const float src[], float scale, int len, float dest[]) {
-  const int rem = len % 4;
-  const int last_index = len - rem;
-  __m128 m_scale = _mm_set_ps1(scale);
-  for (int i = 0; i < last_index; i += 4)
-    _mm_store_ps(dest + i, _mm_mul_ps(_mm_load_ps(src + i), m_scale));
-
-  // Handle any remaining values that wouldn't fit in an SSE pass.
-  for (int i = last_index; i < len; ++i)
-    dest[i] = src[i] * scale;
-}
-
-void FMAC_SSE(const float src[], float scale, int len, float dest[]) {
-  const int rem = len % 4;
-  const int last_index = len - rem;
-  __m128 m_scale = _mm_set_ps1(scale);
-  for (int i = 0; i < last_index; i += 4) {
-    _mm_store_ps(dest + i, _mm_add_ps(_mm_load_ps(dest + i),
-                 _mm_mul_ps(_mm_load_ps(src + i), m_scale)));
-  }
-
-  // Handle any remaining values that wouldn't fit in an SSE pass.
-  for (int i = last_index; i < len; ++i)
-    dest[i] += src[i] * scale;
-}
-
-// Convenience macro to extract float 0 through 3 from the vector |a|.  This is
-// needed because compilers other than clang don't support access via
-// operator[]().
-#define EXTRACT_FLOAT(a, i) \
-    (i == 0 ? \
-         _mm_cvtss_f32(a) : \
-         _mm_cvtss_f32(_mm_shuffle_ps(a, a, i)))
-
-std::pair<float, float> EWMAAndMaxPower_SSE(
-    float initial_value, const float src[], int len, float smoothing_factor) {
-  // When the recurrence is unrolled, we see that we can split it into 4
-  // separate lanes of evaluation:
-  //
-  // y[n] = a(S[n]^2) + (1-a)(y[n-1])
-  //      = a(S[n]^2) + (1-a)^1(aS[n-1]^2) + (1-a)^2(aS[n-2]^2) + ...
-  //      = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3])
-  //
-  // where z[n] = a(S[n]^2) + (1-a)^4(z[n-4]) + (1-a)^8(z[n-8]) + ...
-  //
-  // Thus, the strategy here is to compute z[n], z[n-1], z[n-2], and z[n-3] in
-  // each of the 4 lanes, and then combine them to give y[n].
-
-  const int rem = len % 4;
-  const int last_index = len - rem;
-
-  const __m128 smoothing_factor_x4 = _mm_set_ps1(smoothing_factor);
-  const float weight_prev = 1.0f - smoothing_factor;
-  const __m128 weight_prev_x4 = _mm_set_ps1(weight_prev);
-  const __m128 weight_prev_squared_x4 =
-      _mm_mul_ps(weight_prev_x4, weight_prev_x4);
-  const __m128 weight_prev_4th_x4 =
-      _mm_mul_ps(weight_prev_squared_x4, weight_prev_squared_x4);
-
-  // Compute z[n], z[n-1], z[n-2], and z[n-3] in parallel in lanes 3, 2, 1 and
-  // 0, respectively.
-  __m128 max_x4 = _mm_setzero_ps();
-  __m128 ewma_x4 = _mm_setr_ps(0.0f, 0.0f, 0.0f, initial_value);
-  int i;
-  for (i = 0; i < last_index; i += 4) {
-    ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_4th_x4);
-    const __m128 sample_x4 = _mm_load_ps(src + i);
-    const __m128 sample_squared_x4 = _mm_mul_ps(sample_x4, sample_x4);
-    max_x4 = _mm_max_ps(max_x4, sample_squared_x4);
-    // Note: The compiler optimizes this to a single multiply-and-accumulate
-    // instruction:
-    ewma_x4 = _mm_add_ps(ewma_x4,
-                         _mm_mul_ps(sample_squared_x4, smoothing_factor_x4));
-  }
-
-  // y[n] = z[n] + (1-a)^1(z[n-1]) + (1-a)^2(z[n-2]) + (1-a)^3(z[n-3])
-  float ewma = EXTRACT_FLOAT(ewma_x4, 3);
-  ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4);
-  ewma += EXTRACT_FLOAT(ewma_x4, 2);
-  ewma_x4 = _mm_mul_ps(ewma_x4, weight_prev_x4);
-  ewma += EXTRACT_FLOAT(ewma_x4, 1);
-  ewma_x4 = _mm_mul_ss(ewma_x4, weight_prev_x4);
-  ewma += EXTRACT_FLOAT(ewma_x4, 0);
-
-  // Fold the maximums together to get the overall maximum.
-  max_x4 = _mm_max_ps(max_x4,
-                      _mm_shuffle_ps(max_x4, max_x4, _MM_SHUFFLE(3, 3, 1, 1)));
-  max_x4 = _mm_max_ss(max_x4, _mm_shuffle_ps(max_x4, max_x4, 2));
-
-  std::pair<float, float> result(ewma, EXTRACT_FLOAT(max_x4, 0));
-
-  // Handle remaining values at the end of |src|.
-  for (; i < len; ++i) {
-    result.first *= weight_prev;
-    const float sample = src[i];
-    const float sample_squared = sample * sample;
-    result.first += sample_squared * smoothing_factor;
-    result.second = std::max(result.second, sample_squared);
-  }
-
-  return result;
-}
-#endif
-
 #if defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
 void FMAC_NEON(const float src[], float scale, int len, float dest[]) {
   const int rem = len % 4;
diff --git a/src/3rdparty/chromium/media/base/vector_math.h b/src/3rdparty/chromium/media/base/vector_math.h
index a148ca050..0a2cb06f6 100644
--- a/src/3rdparty/chromium/media/base/vector_math.h
+++ b/src/3rdparty/chromium/media/base/vector_math.h
@@ -15,6 +15,11 @@ namespace vector_math {
 // Required alignment for inputs and outputs to all vector math functions
 enum { kRequiredAlignment = 16 };
 
+// Selects runtime specific optimizations such as SSE.  Must be called prior to
+// calling FMAC() or FMUL().  Called during media library initialization; most
+// users should never have to call this.
+MEDIA_EXPORT void Initialize();
+
 // Multiply each element of |src| (up to |len|) by |scale| and add to |dest|.
 // |src| and |dest| must be aligned by kRequiredAlignment.
 MEDIA_EXPORT void FMAC(const float src[], float scale, int len, float dest[]);
diff --git a/src/3rdparty/chromium/media/base/vector_math_perftest.cc b/src/3rdparty/chromium/media/base/vector_math_perftest.cc
index 59b259dc2..c4c89a3b5 100644
--- a/src/3rdparty/chromium/media/base/vector_math_perftest.cc
+++ b/src/3rdparty/chromium/media/base/vector_math_perftest.cc
@@ -5,6 +5,7 @@
 #include <memory>
 
 #include "base/macros.h"
+#include "base/cpu.h"
 #include "base/memory/aligned_memory.h"
 #include "base/time/time.h"
 #include "build/build_config.h"
@@ -82,15 +83,11 @@ class VectorMathPerfTest : public testing::Test {
   DISALLOW_COPY_AND_ASSIGN(VectorMathPerfTest);
 };
 
-// Define platform dependent function names for SIMD optimized methods.
+// Define platform independent function name for FMAC* perf tests.
 #if defined(ARCH_CPU_X86_FAMILY)
 #define FMAC_FUNC FMAC_SSE
-#define FMUL_FUNC FMUL_SSE
-#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_SSE
 #elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
 #define FMAC_FUNC FMAC_NEON
-#define FMUL_FUNC FMUL_NEON
-#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON
 #endif
 
 // Benchmark for each optimized vector_math::FMAC() method.
@@ -99,6 +96,9 @@ TEST_F(VectorMathPerfTest, FMAC) {
   RunBenchmark(
       vector_math::FMAC_C, true, "vector_math_fmac", "unoptimized");
 #if defined(FMAC_FUNC)
+#if defined(ARCH_CPU_X86_FAMILY)
+  ASSERT_TRUE(base::CPU().has_sse());
+#endif
   // Benchmark FMAC_FUNC() with unaligned size.
   ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
                                  sizeof(float)), 0U);
@@ -112,12 +112,24 @@ TEST_F(VectorMathPerfTest, FMAC) {
 #endif
 }
 
+#undef FMAC_FUNC
+
+// Define platform independent function name for FMULBenchmark* tests.
+#if defined(ARCH_CPU_X86_FAMILY)
+#define FMUL_FUNC FMUL_SSE
+#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+#define FMUL_FUNC FMUL_NEON
+#endif
+
 // Benchmark for each optimized vector_math::FMUL() method.
 TEST_F(VectorMathPerfTest, FMUL) {
   // Benchmark FMUL_C().
   RunBenchmark(
       vector_math::FMUL_C, true, "vector_math_fmul", "unoptimized");
 #if defined(FMUL_FUNC)
+#if defined(ARCH_CPU_X86_FAMILY)
+  ASSERT_TRUE(base::CPU().has_sse());
+#endif
   // Benchmark FMUL_FUNC() with unaligned size.
   ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
                                  sizeof(float)), 0U);
@@ -131,6 +143,14 @@ TEST_F(VectorMathPerfTest, FMUL) {
 #endif
 }
 
+#undef FMUL_FUNC
+
+#if defined(ARCH_CPU_X86_FAMILY)
+#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_SSE
+#elif defined(ARCH_CPU_ARM_FAMILY) && defined(USE_NEON)
+#define EWMAAndMaxPower_FUNC EWMAAndMaxPower_NEON
+#endif
+
 // Benchmark for each optimized vector_math::EWMAAndMaxPower() method.
 TEST_F(VectorMathPerfTest, EWMAAndMaxPower) {
   // Benchmark EWMAAndMaxPower_C().
@@ -139,6 +159,9 @@ TEST_F(VectorMathPerfTest, EWMAAndMaxPower) {
                "vector_math_ewma_and_max_power",
                "unoptimized");
 #if defined(EWMAAndMaxPower_FUNC)
+#if defined(ARCH_CPU_X86_FAMILY)
+  ASSERT_TRUE(base::CPU().has_sse());
+#endif
   // Benchmark EWMAAndMaxPower_FUNC() with unaligned size.
   ASSERT_NE((kVectorSize - 1) % (vector_math::kRequiredAlignment /
                                  sizeof(float)), 0U);
@@ -156,4 +179,6 @@ TEST_F(VectorMathPerfTest, EWMAAndMaxPower) {
 #endif
 }
 
+#undef EWMAAndMaxPower_FUNC
+
 } // namespace media
diff --git a/src/3rdparty/chromium/media/base/vector_math_testing.h b/src/3rdparty/chromium/media/base/vector_math_testing.h
index 9240fbf54..b0b304409 100644
--- a/src/3rdparty/chromium/media/base/vector_math_testing.h
+++ b/src/3rdparty/chromium/media/base/vector_math_testing.h
@@ -19,7 +19,7 @@ MEDIA_EXPORT void FMUL_C(const float src[], float scale, int len, float dest[]);
 MEDIA_EXPORT std::pair<float, float> EWMAAndMaxPower_C(
     float initial_value, const float src[], int len, float smoothing_factor);
 
-#if defined(ARCH_CPU_X86_FAMILY) && !defined(OS_NACL)
+#if defined(ARCH_CPU_X86_FAMILY)
 MEDIA_EXPORT void FMAC_SSE(const float src[], float scale, int len,
                            float dest[]);
 MEDIA_EXPORT void FMUL_SSE(const float src[], float scale, int len,
diff --git a/src/3rdparty/chromium/media/base/vector_math_unittest.cc b/src/3rdparty/chromium/media/base/vector_math_unittest.cc
index 3fcb3fad4..c4e8586aa 100644
--- a/src/3rdparty/chromium/media/base/vector_math_unittest.cc
+++ b/src/3rdparty/chromium/media/base/vector_math_unittest.cc
@@ -9,6 +9,7 @@
 #include <memory>
 
 #include "base/macros.h"
+#include "base/cpu.h"
 #include "base/memory/aligned_memory.h"
 #include "base/strings/string_number_conversions.h"
 #include "base/strings/stringize_macros.h"
@@ -78,6 +79,7 @@ TEST_F(VectorMathTest, FMAC) {
 
 #if defined(ARCH_CPU_X86_FAMILY)
   {
+    ASSERT_TRUE(base::CPU().has_sse());
     SCOPED_TRACE("FMAC_SSE");
     FillTestVectors(kInputFillValue, kOutputFillValue);
     vector_math::FMAC_SSE(
@@ -119,6 +121,7 @@ TEST_F(VectorMathTest, FMUL) {
 
 #if defined(ARCH_CPU_X86_FAMILY)
   {
+    ASSERT_TRUE(base::CPU().has_sse());
     SCOPED_TRACE("FMUL_SSE");
     FillTestVectors(kInputFillValue, kOutputFillValue);
     vector_math::FMUL_SSE(
@@ -227,6 +230,7 @@ class EWMATestScenario {
 
 #if defined(ARCH_CPU_X86_FAMILY)
     {
+      ASSERT_TRUE(base::CPU().has_sse());
       SCOPED_TRACE("EWMAAndMaxPower_SSE");
       const std::pair<float, float>& result = vector_math::EWMAAndMaxPower_SSE(
           initial_value_, data_.get(), data_len_, smoothing_factor_);
diff --git a/src/3rdparty/chromium/media/base/yuv_convert.cc b/src/3rdparty/chromium/media/base/yuv_convert.cc
index 2cdd9b1fd..2fc643416 100644
--- a/src/3rdparty/chromium/media/base/yuv_convert.cc
+++ b/src/3rdparty/chromium/media/base/yuv_convert.cc
@@ -32,7 +32,7 @@
 #include "media/base/simd/convert_yuv_to_rgb.h"
 #include "media/base/simd/filter_yuv.h"
 
-#if defined(ARCH_CPU_X86_FAMILY)
+#if defined(ARCH_CPU_X86_FAMILY) && defined(__MMX__)
 #if defined(COMPILER_MSVC)
 #include <intrin.h>
 #else
@@ -133,7 +133,7 @@ static const int16_t* g_table_rec709_ptr = NULL;
 
 // Empty SIMD registers state after using them.
 void EmptyRegisterStateStub() {}
-#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) && defined(__MMX__)
 void EmptyRegisterStateIntrinsic() { _mm_empty(); }
 #endif
 typedef void (*EmptyRegisterStateProc)();
@@ -247,34 +247,46 @@ void InitializeCPUSpecificYUVConversions() {
   // Assembly code confuses MemorySanitizer. Also not available in iOS builds.
 #if defined(ARCH_CPU_X86_FAMILY) && !defined(MEMORY_SANITIZER) && \
     !defined(OS_IOS)
-  g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX;
+  base::CPU cpu;
+  if (cpu.has_mmx()) {
+    g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_MMX;
+    g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_MMX;
+    g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_MMX;
+    g_convert_yuva_to_argb_proc_ = ConvertYUVAToARGB_MMX;
+    g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX;
 
 #if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
-  g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic;
+    g_filter_yuv_rows_proc_ = FilterYUVRows_MMX;
+#endif
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE) && defined(__MMX__)
+    g_empty_register_state_proc_ = EmptyRegisterStateIntrinsic;
 #else
-  g_empty_register_state_proc_ = EmptyRegisterState_MMX;
+    g_empty_register_state_proc_ = EmptyRegisterState_MMX;
 #endif
+  }
 
-  g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE;
-  g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE;
+  if (cpu.has_sse()) {
+    g_convert_yuv_to_rgb32_row_proc_ = ConvertYUVToRGB32Row_SSE;
+    g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE;
+    g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE;
+    g_convert_yuv_to_rgb32_proc_ = ConvertYUVToRGB32_SSE;
+  }
 
-  g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2;
-  g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2;
+  if (cpu.has_sse2()) {
+    g_filter_yuv_rows_proc_ = FilterYUVRows_SSE2;
+    g_convert_rgb32_to_yuv_proc_ = ConvertRGB32ToYUV_SSE2;
 
 #if defined(ARCH_CPU_X86_64)
-  g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64;
+    g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE2_X64;
 
-  // Technically this should be in the MMX section, but MSVC will optimize out
-  // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit
-  // tests, if that decision can be made at compile time.  Since all X64 CPUs
-  // have SSE2, we can hack around this by making the selection here.
-  g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64;
-#else
-  g_scale_yuv_to_rgb32_row_proc_ = ScaleYUVToRGB32Row_SSE;
-  g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_SSE;
+    // Technically this should be in the MMX section, but MSVC will optimize out
+    // the export of LinearScaleYUVToRGB32Row_MMX, which is required by the unit
+    // tests, if that decision can be made at compile time.  Since all X64 CPUs
+    // have SSE2, we can hack around this by making the selection here.
+    g_linear_scale_yuv_to_rgb32_row_proc_ = LinearScaleYUVToRGB32Row_MMX_X64;
 #endif
+  }
 
-  base::CPU cpu;
   if (cpu.has_ssse3()) {
     g_convert_rgb24_to_yuv_proc_ = &ConvertRGB24ToYUV_SSSE3;
 
diff --git a/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc b/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc
index ddf777cf3..f5520fd58 100644
--- a/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc
+++ b/src/3rdparty/chromium/media/base/yuv_convert_perftest.cc
@@ -71,6 +71,29 @@ class YUVConvertPerfTest : public testing::Test {
   DISALLOW_COPY_AND_ASSIGN(YUVConvertPerfTest);
 };
 
+TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_MMX) {
+  ASSERT_TRUE(base::CPU().has_mmx());
+
+  base::TimeTicks start = base::TimeTicks::Now();
+  for (int i = 0; i < kPerfTestIterations; ++i) {
+    for (int row = 0; row < kSourceHeight; ++row) {
+      int chroma_row = row / 2;
+      ConvertYUVToRGB32Row_MMX(
+          yuv_bytes_.get() + row * kSourceWidth,
+          yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2),
+          yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2),
+          rgb_bytes_converted_.get(),
+          kWidth,
+          GetLookupTable(YV12));
+    }
+  }
+  media::EmptyRegisterState();
+  double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF();
+  perf_test::PrintResult(
+      "yuv_convert_perftest", "", "ConvertYUVToRGB32Row_MMX",
+      kPerfTestIterations / total_time_seconds, "runs/s", true);
+}
+
 TEST_F(YUVConvertPerfTest, ConvertYUVToRGB32Row_SSE) {
   ASSERT_TRUE(base::CPU().has_sse());
 
@@ -161,9 +184,32 @@ TEST_F(YUVConvertPerfTest, I422AlphaToARGBRow_SSSE3) {
 }
 #endif
 
-// 64-bit release + component builds on Windows are too smart and optimizes
-// away the function being tested.
-#if defined(OS_WIN) && (defined(ARCH_CPU_X86) || !defined(COMPONENT_BUILD))
+TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_MMX) {
+  ASSERT_TRUE(base::CPU().has_mmx());
+
+  const int kSourceDx = 80000;  // This value means a scale down.
+
+  base::TimeTicks start = base::TimeTicks::Now();
+  for (int i = 0; i < kPerfTestIterations; ++i) {
+    for (int row = 0; row < kSourceHeight; ++row) {
+      int chroma_row = row / 2;
+      ScaleYUVToRGB32Row_MMX(
+          yuv_bytes_.get() + row * kSourceWidth,
+          yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2),
+          yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2),
+          rgb_bytes_converted_.get(),
+          kWidth,
+          kSourceDx,
+          GetLookupTable(YV12));
+    }
+  }
+  media::EmptyRegisterState();
+  double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF();
+  perf_test::PrintResult(
+      "yuv_convert_perftest", "", "ScaleYUVToRGB32Row_MMX",
+      kPerfTestIterations / total_time_seconds, "runs/s", true);
+}
+
 TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_SSE) {
   ASSERT_TRUE(base::CPU().has_sse());
 
@@ -190,6 +236,32 @@ TEST_F(YUVConvertPerfTest, ScaleYUVToRGB32Row_SSE) {
       kPerfTestIterations / total_time_seconds, "runs/s", true);
 }
 
+TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_MMX) {
+  ASSERT_TRUE(base::CPU().has_mmx());
+
+  const int kSourceDx = 80000;  // This value means a scale down.
+
+  base::TimeTicks start = base::TimeTicks::Now();
+  for (int i = 0; i < kPerfTestIterations; ++i) {
+    for (int row = 0; row < kSourceHeight; ++row) {
+      int chroma_row = row / 2;
+      LinearScaleYUVToRGB32Row_MMX(
+          yuv_bytes_.get() + row * kSourceWidth,
+          yuv_bytes_.get() + kSourceUOffset + (chroma_row * kSourceWidth / 2),
+          yuv_bytes_.get() + kSourceVOffset + (chroma_row * kSourceWidth / 2),
+          rgb_bytes_converted_.get(),
+          kWidth,
+          kSourceDx,
+          GetLookupTable(YV12));
+    }
+  }
+  media::EmptyRegisterState();
+  double total_time_seconds = (base::TimeTicks::Now() - start).InSecondsF();
+  perf_test::PrintResult(
+      "yuv_convert_perftest", "", "LinearScaleYUVToRGB32Row_MMX",
+      kPerfTestIterations / total_time_seconds, "runs/s", true);
+}
+
 TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_SSE) {
   ASSERT_TRUE(base::CPU().has_sse());
 
@@ -215,7 +287,6 @@ TEST_F(YUVConvertPerfTest, LinearScaleYUVToRGB32Row_SSE) {
       "yuv_convert_perftest", "", "LinearScaleYUVToRGB32Row_SSE",
       kPerfTestIterations / total_time_seconds, "runs/s", true);
 }
-#endif  // defined(OS_WIN) && (ARCH_CPU_X86 || COMPONENT_BUILD)
 
 #endif  // !defined(ARCH_CPU_ARM_FAMILY) && !defined(ARCH_CPU_MIPS_FAMILY)
 
diff --git a/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc b/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc
index ec872c89b..801466add 100644
--- a/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc
+++ b/src/3rdparty/chromium/media/base/yuv_convert_unittest.cc
@@ -643,6 +643,37 @@ TEST(YUVConvertTest, RGB32ToYUV_SSE2_MatchReference) {
   EXPECT_EQ(0, error);
 }
 
+TEST(YUVConvertTest, ConvertYUVToRGB32Row_MMX) {
+  base::CPU cpu;
+  if (!cpu.has_mmx()) {
+    LOG(WARNING) << "System not supported. Test skipped.";
+    return;
+  }
+
+  scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]);
+  scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]);
+  scoped_ptr<uint8[]> rgb_bytes_converted(new uint8[kRGBSize]);
+  ReadYV12Data(&yuv_bytes);
+
+  const int kWidth = 167;
+  ConvertYUVToRGB32Row_C(yuv_bytes.get(),
+                         yuv_bytes.get() + kSourceUOffset,
+                         yuv_bytes.get() + kSourceVOffset,
+                         rgb_bytes_reference.get(),
+                         kWidth,
+                         GetLookupTable(YV12));
+  ConvertYUVToRGB32Row_MMX(yuv_bytes.get(),
+                           yuv_bytes.get() + kSourceUOffset,
+                           yuv_bytes.get() + kSourceVOffset,
+                           rgb_bytes_converted.get(),
+                           kWidth,
+                           GetLookupTable(YV12));
+  media::EmptyRegisterState();
+  EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
+                      rgb_bytes_converted.get(),
+                      kWidth * kBpp));
+}
+
 TEST(YUVConvertTest, ConvertYUVToRGB32Row_SSE) {
   base::CPU cpu;
   if (!cpu.has_sse()) {
@@ -674,9 +705,40 @@ TEST(YUVConvertTest, ConvertYUVToRGB32Row_SSE) {
                       kWidth * kBpp));
 }
 
-// 64-bit release + component builds on Windows are too smart and optimizes
-// away the function being tested.
-#if defined(OS_WIN) && (defined(ARCH_CPU_X86) || !defined(COMPONENT_BUILD))
+TEST(YUVConvertTest, ScaleYUVToRGB32Row_MMX) {
+  base::CPU cpu;
+  if (!cpu.has_mmx()) {
+    LOG(WARNING) << "System not supported. Test skipped.";
+    return;
+  }
+
+  scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]);
+  scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]);
+  scoped_ptr<uint8[]> rgb_bytes_converted(new uint8[kRGBSize]);
+  ReadYV12Data(&yuv_bytes);
+
+  const int kWidth = 167;
+  const int kSourceDx = 80000;  // This value means a scale down.
+  ScaleYUVToRGB32Row_C(yuv_bytes.get(),
+                       yuv_bytes.get() + kSourceUOffset,
+                       yuv_bytes.get() + kSourceVOffset,
+                       rgb_bytes_reference.get(),
+                       kWidth,
+                       kSourceDx,
+                       GetLookupTable(YV12));
+  ScaleYUVToRGB32Row_MMX(yuv_bytes.get(),
+                         yuv_bytes.get() + kSourceUOffset,
+                         yuv_bytes.get() + kSourceVOffset,
+                         rgb_bytes_converted.get(),
+                         kWidth,
+                         kSourceDx,
+                         GetLookupTable(YV12));
+  media::EmptyRegisterState();
+  EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
+                      rgb_bytes_converted.get(),
+                      kWidth * kBpp));
+}
+
 TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE) {
   base::CPU cpu;
   if (!cpu.has_sse()) {
@@ -711,6 +773,40 @@ TEST(YUVConvertTest, ScaleYUVToRGB32Row_SSE) {
                       kWidth * kBpp));
 }
 
+TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_MMX) {
+  base::CPU cpu;
+  if (!cpu.has_mmx()) {
+    LOG(WARNING) << "System not supported. Test skipped.";
+    return;
+  }
+
+  scoped_ptr<uint8[]> yuv_bytes(new uint8[kYUV12Size]);
+  scoped_ptr<uint8[]> rgb_bytes_reference(new uint8[kRGBSize]);
+  scoped_ptr<uint8[]> rgb_bytes_converted(new uint8[kRGBSize]);
+  ReadYV12Data(&yuv_bytes);
+
+  const int kWidth = 167;
+  const int kSourceDx = 80000;  // This value means a scale down.
+  LinearScaleYUVToRGB32Row_C(yuv_bytes.get(),
+                             yuv_bytes.get() + kSourceUOffset,
+                             yuv_bytes.get() + kSourceVOffset,
+                             rgb_bytes_reference.get(),
+                             kWidth,
+                             kSourceDx,
+                             GetLookupTable(YV12));
+  LinearScaleYUVToRGB32Row_MMX(yuv_bytes.get(),
+                               yuv_bytes.get() + kSourceUOffset,
+                               yuv_bytes.get() + kSourceVOffset,
+                               rgb_bytes_converted.get(),
+                               kWidth,
+                               kSourceDx,
+                               GetLookupTable(YV12));
+  media::EmptyRegisterState();
+  EXPECT_EQ(0, memcmp(rgb_bytes_reference.get(),
+                      rgb_bytes_converted.get(),
+                      kWidth * kBpp));
+}
+
 TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_SSE) {
   base::CPU cpu;
   if (!cpu.has_sse()) {
@@ -744,7 +840,6 @@ TEST(YUVConvertTest, LinearScaleYUVToRGB32Row_SSE) {
                       rgb_bytes_converted.get(),
                       kWidth * kBpp));
 }
-#endif  // defined(OS_WIN) && (ARCH_CPU_X86 || COMPONENT_BUILD)
 
 TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) {
   std::unique_ptr<uint8_t[]> src(new uint8_t[16]);
@@ -761,6 +856,30 @@ TEST(YUVConvertTest, FilterYUVRows_C_OutOfBounds) {
   }
 }
 
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+TEST(YUVConvertTest, FilterYUVRows_MMX_OutOfBounds) {
+  base::CPU cpu;
+  if (!cpu.has_mmx()) {
+    LOG(WARNING) << "System not supported. Test skipped.";
+    return;
+  }
+
+  scoped_ptr<uint8[]> src(new uint8[16]);
+  scoped_ptr<uint8[]> dst(new uint8[16]);
+
+  memset(src.get(), 0xff, 16);
+  memset(dst.get(), 0, 16);
+
+  media::FilterYUVRows_MMX(dst.get(), src.get(), src.get(), 1, 255);
+  media::EmptyRegisterState();
+
+  EXPECT_EQ(255u, dst[0]);
+  for (int i = 1; i < 16; ++i) {
+    EXPECT_EQ(0u, dst[i]);
+  }
+}
+#endif  // defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+
 TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) {
   base::CPU cpu;
   if (!cpu.has_sse2()) {
@@ -782,6 +901,38 @@ TEST(YUVConvertTest, FilterYUVRows_SSE2_OutOfBounds) {
   }
 }
 
+#if defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+TEST(YUVConvertTest, FilterYUVRows_MMX_UnalignedDestination) {
+  base::CPU cpu;
+  if (!cpu.has_mmx()) {
+    LOG(WARNING) << "System not supported. Test skipped.";
+    return;
+  }
+
+  const int kSize = 32;
+  scoped_ptr<uint8[]> src(new uint8[kSize]);
+  scoped_ptr<uint8[]> dst_sample(new uint8[kSize]);
+  scoped_ptr<uint8[]> dst(new uint8[kSize]);
+
+  memset(dst_sample.get(), 0, kSize);
+  memset(dst.get(), 0, kSize);
+  for (int i = 0; i < kSize; ++i)
+    src[i] = 100 + i;
+
+  media::FilterYUVRows_C(dst_sample.get(),
+                         src.get(), src.get(), 17, 128);
+
+  // Generate an unaligned output address.
+  uint8* dst_ptr =
+      reinterpret_cast<uint8*>(
+          (reinterpret_cast<uintptr_t>(dst.get() + 8) & ~7) + 1);
+  media::FilterYUVRows_MMX(dst_ptr, src.get(), src.get(), 17, 128);
+  media::EmptyRegisterState();
+
+  EXPECT_EQ(0, memcmp(dst_sample.get(), dst_ptr, 17));
+}
+#endif  // defined(MEDIA_MMX_INTRINSICS_AVAILABLE)
+
 TEST(YUVConvertTest, FilterYUVRows_SSE2_UnalignedDestination) {
   base::CPU cpu;
   if (!cpu.has_sse2()) {
diff --git a/src/3rdparty/chromium/skia/BUILD.gn b/src/3rdparty/chromium/skia/BUILD.gn
index 55854ffe6..9a1d4ec0f 100644
--- a/src/3rdparty/chromium/skia/BUILD.gn
+++ b/src/3rdparty/chromium/skia/BUILD.gn
@@ -1,38 +1,3 @@
-# Copyright (c) 2013 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import("//build/config/features.gni")
-import("//build/config/ui.gni")
-import("//printing/features/features.gni")
-import("//testing/test.gni")
-import("//third_party/skia/gn/shared_sources.gni")
-
-if (current_cpu == "arm") {
-  import("//build/config/arm.gni")
-}
-if (current_cpu == "mipsel" || current_cpu == "mips64el") {
-  import("//build/config/mips.gni")
-}
-
-skia_support_gpu = !is_ios
-skia_support_pdf = !is_ios && (enable_basic_printing || enable_print_preview)
-
-# When building Chrome for iOS with GYP, the target cpu is not known during
-# the invocation of gyp. This cause the iOS build to use non-optimised skia.
-# Replicate this with GN to avoid introducing regression as recommended by
-# the OWNERS of skia.
-
-declare_args() {
-  skia_whitelist_serialized_typefaces = false
-
-  # TODO(crbug.com/607933): Once GYP is no longer supported, port iOS to use
-  # optimised skia.
-  skia_build_no_opts = is_ios
-}
-
-# External-facing config for dependent code.
-config("skia_config") {
   include_dirs = [
     "config",
     "ext",
@@ -608,7 +573,15 @@ source_set("skia_opts") {
   if (skia_build_no_opts) {
     sources = skia_opts.none_sources
   } else if (current_cpu == "x86" || current_cpu == "x64") {
-    sources = skia_opts.sse2_sources
+    sources = skia_opts.sse2_sources +
+              [
+                # Chrome-specific.
+                "ext/convolver_SSE2.cc",
+                "ext/convolver_SSE2.h",
+              ]
+    if (!is_win || is_clang) {
+      cflags += [ "-msse2" ]
+    }
     deps += [
       ":skia_opts_avx",
       ":skia_opts_hsw",
@@ -644,6 +617,13 @@ source_set("skia_opts") {
 
     if (mips_dsp_rev >= 1) {
       sources = skia_opts.mips_dsp_sources
+      if (mips_dsp_rev >= 2) {
+        sources += [
+          # Chrome-specific.
+          "ext/convolver_mips_dspr2.cc",
+          "ext/convolver_mips_dspr2.h",
+        ]
+      }
     } else {
       sources = skia_opts.none_sources
     }
diff --git a/src/3rdparty/chromium/skia/ext/convolver.cc b/src/3rdparty/chromium/skia/ext/convolver.cc
index 092fefaa9..4b40ffd2c 100644
--- a/src/3rdparty/chromium/skia/ext/convolver.cc
+++ b/src/3rdparty/chromium/skia/ext/convolver.cc
@@ -362,10 +362,13 @@ struct ConvolveProcs {
 
 void SetupSIMD(ConvolveProcs *procs) {
 #ifdef SIMD_SSE2
-  procs->extra_horizontal_reads = 3;
-  procs->convolve_vertically = &ConvolveVertically_SSE2;
-  procs->convolve_4rows_horizontally = &Convolve4RowsHorizontally_SSE2;
-  procs->convolve_horizontally = &ConvolveHorizontally_SSE2;
+  base::CPU cpu;
+  if (cpu.has_sse2()) {
+    procs->extra_horizontal_reads = 3;
+    procs->convolve_vertically = &ConvolveVertically_SSE2;
+    procs->convolve_4rows_horizontally = &Convolve4RowsHorizontally_SSE2;
+    procs->convolve_horizontally = &ConvolveHorizontally_SSE2;
+  }
 #elif defined SIMD_MIPS_DSPR2
   procs->extra_horizontal_reads = 3;
   procs->convolve_vertically = &ConvolveVertically_mips_dspr2;
diff --git a/src/3rdparty/chromium/skia/ext/convolver.h b/src/3rdparty/chromium/skia/ext/convolver.h
index 1f33d4c0f..f7cd4770a 100644
--- a/src/3rdparty/chromium/skia/ext/convolver.h
+++ b/src/3rdparty/chromium/skia/ext/convolver.h
@@ -11,6 +11,7 @@
 #include <vector>
 
 #include "build/build_config.h"
+#include "base/cpu.h"
 #include "third_party/skia/include/core/SkSize.h"
 #include "third_party/skia/include/core/SkTypes.h"
 
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
index 8e558f439..20ba17688 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/modules/webaudio/AudioParamTimeline.cpp
@@ -31,7 +31,7 @@
 #include "wtf/MathExtras.h"
 #include <algorithm>
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
 #include <emmintrin.h>
 #endif
 
@@ -662,7 +662,7 @@ float AudioParamTimeline::valuesForFrameRangeImpl(size_t startFrame,
     // the next event.
     if (nextEventType == ParamEvent::LinearRampToValue) {
       const float valueDelta = value2 - value1;
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
       if (fillToFrame > writeIndex) {
         // Minimize in-loop operations. Calculate starting value and increment.
         // Next step: value += inc.
@@ -841,7 +841,7 @@ float AudioParamTimeline::valuesForFrameRangeImpl(size_t startFrame,
             for (; writeIndex < fillToFrame; ++writeIndex)
               values[writeIndex] = target;
           } else {
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
             if (fillToFrame > writeIndex) {
               // Resolve recursion by expanding constants to achieve a 4-step
               // loop unrolling.
@@ -959,7 +959,7 @@ float AudioParamTimeline::valuesForFrameRangeImpl(size_t startFrame,
           // Oversampled curve data can be provided if sharp discontinuities are
           // desired.
           unsigned k = 0;
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
           if (fillToFrame > writeIndex) {
             const __m128 vCurveVirtualIndex = _mm_set_ps1(curveVirtualIndex);
             const __m128 vCurvePointsPerFrame =
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp
index a77ec195c..d76c2d015 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.cpp
@@ -26,6 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+// include this first to get it before the CPU() function-like macro
+#include "base/cpu.h"
+
 #include "platform/audio/DirectConvolver.h"
 
 #if OS(MACOSX)
@@ -35,21 +38,45 @@
 #include "platform/audio/VectorMath.h"
 #include "wtf/CPU.h"
 
-#if (CPU(X86) || CPU(X86_64)) && !OS(MACOSX)
+#if ((CPU(X86) && defined(__SSE2__)) || CPU(X86_64)) && !OS(MACOSX)
 #include <emmintrin.h>
 #endif
 
+#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__)
+#error SSE2 parts must be built with -msse2
+#endif
+
 namespace blink {
 
 using namespace VectorMath;
 
+#ifndef BUILD_ONLY_THE_SSE2_PARTS
+
 DirectConvolver::DirectConvolver(size_t inputBlockSize)
-    : m_inputBlockSize(inputBlockSize), m_buffer(inputBlockSize * 2) {}
+    : m_inputBlockSize(inputBlockSize), m_buffer(inputBlockSize * 2)
+{
+#if CPU(X86)
+    base::CPU cpu;
+    m_haveSSE2 = cpu.has_sse2();
+#endif
+}
+#endif
 
+#ifdef BUILD_ONLY_THE_SSE2_PARTS
+void DirectConvolver::m_processSSE2(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess)
+#else
 void DirectConvolver::process(AudioFloatArray* convolutionKernel,
                               const float* sourceP,
                               float* destP,
-                              size_t framesToProcess) {
+                              size_t framesToProcess)
+#endif
+{
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
+    if (m_haveSSE2) {
+        m_processSSE2(convolutionKernel, sourceP, destP, framesToProcess);
+        return;
+    }
+#endif
   ASSERT(framesToProcess == m_inputBlockSize);
   if (framesToProcess != m_inputBlockSize)
     return;
@@ -83,7 +110,7 @@ void DirectConvolver::process(AudioFloatArray* convolutionKernel,
 #endif  // CPU(X86)
 #else
   size_t i = 0;
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   // Convolution using SSE2. Currently only do this if both |kernelSize| and
   // |framesToProcess| are multiples of 4. If not, use the straightforward loop
   // below.
@@ -397,7 +424,7 @@ void DirectConvolver::process(AudioFloatArray* convolutionKernel,
       }
       destP[i++] = sum;
     }
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   }
 #endif
 #endif  // OS(MACOSX)
@@ -406,8 +433,9 @@ void DirectConvolver::process(AudioFloatArray* convolutionKernel,
   memcpy(m_buffer.data(), inputP, sizeof(float) * framesToProcess);
 }
 
+#ifndef BUILD_ONLY_THE_SSE2_PARTS
 void DirectConvolver::reset() {
   m_buffer.zero();
 }
-
+#endif
 }  // namespace blink
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h
index 848f6aa73..78ea0d84c 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/DirectConvolver.h
@@ -32,6 +32,7 @@
 #include "platform/PlatformExport.h"
 #include "platform/audio/AudioArray.h"
 #include "wtf/Allocator.h"
+#include "wtf/CPU.h"
 #include "wtf/Noncopyable.h"
 
 namespace blink {
@@ -54,6 +55,12 @@ class PLATFORM_EXPORT DirectConvolver {
   size_t m_inputBlockSize;
 
   AudioFloatArray m_buffer;
+
+#if CPU(X86)
+    bool m_haveSSE2;
+    void m_processSSE2(AudioFloatArray* convolutionKernel, const float* sourceP, float* destP, size_t framesToProcess);
+#endif
+
 };
 
 }  // namespace blink
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp
index e7ca2c77d..a0ad93953 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.cpp
@@ -26,15 +26,22 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+// include this first to get it before the CPU() function-like macro
+#include "base/cpu.h"
+
 #include "platform/audio/SincResampler.h"
 #include "platform/audio/AudioBus.h"
 #include "wtf/CPU.h"
 #include "wtf/MathExtras.h"
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
 #include <emmintrin.h>
 #endif
 
+#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__)
+#error SSE2 parts must be built with -msse2
+#endif
+
 // Input buffer layout, dividing the total buffer into regions (r0 - r5):
 //
 // |----------------|-----------------------------------------|----------------|
@@ -66,6 +73,8 @@
 
 namespace blink {
 
+#ifndef BUILD_ONLY_THE_SSE2_PARTS
+
 SincResampler::SincResampler(double scaleFactor,
                              unsigned kernelSize,
                              unsigned numberOfKernelOffsets)
@@ -81,6 +90,10 @@ SincResampler::SincResampler(double scaleFactor,
       m_sourceFramesAvailable(0),
       m_sourceProvider(nullptr),
       m_isBufferPrimed(false) {
+#if CPU(X86)
+    base::CPU cpu;
+    m_haveSSE2 = cpu.has_sse2();
+#endif
   initializeKernel();
 }
 
@@ -200,10 +213,22 @@ void SincResampler::process(const float* source,
     remaining -= framesThisTime;
   }
 }
+#endif //BUILD_ONLY_THE_SSE2_PARTS
 
+#ifdef BUILD_ONLY_THE_SSE2_PARTS
+void SincResampler::m_processSSE2(AudioSourceProvider* sourceProvider, float* destination, size_t framesToProcess)
+#else
 void SincResampler::process(AudioSourceProvider* sourceProvider,
                             float* destination,
-                            size_t framesToProcess) {
+                            size_t framesToProcess)
+#endif
+{
+#if CPU(X86) && !defined(__SSE2__)
+    if (m_haveSSE2) {
+        m_processSSE2(sourceProvider, destination, framesToProcess);
+        return;
+    }
+#endif
   bool isGood = sourceProvider && m_blockSize > m_kernelSize &&
                 m_inputBuffer.size() >= m_blockSize + m_kernelSize &&
                 !(m_kernelSize % 2);
@@ -269,7 +294,7 @@ void SincResampler::process(AudioSourceProvider* sourceProvider,
       {
         float input;
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
         // If the sourceP address is not 16-byte aligned, the first several
         // frames (at most three) should be processed seperately.
         while ((reinterpret_cast<uintptr_t>(inputP) & 0x0F) && n) {
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h
index b96ec94cf..4b6b3293e 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/SincResampler.h
@@ -33,6 +33,7 @@
 #include "platform/audio/AudioArray.h"
 #include "platform/audio/AudioSourceProvider.h"
 #include "wtf/Allocator.h"
+#include "wtf/CPU.h"
 #include "wtf/Noncopyable.h"
 
 namespace blink {
@@ -96,6 +97,12 @@ class PLATFORM_EXPORT SincResampler {
 
   // The buffer is primed once at the very beginning of processing.
   bool m_isBufferPrimed;
+
+#if CPU(X86)
+  bool m_haveSSE2;
+  void m_processSSE2(AudioSourceProvider*, float* destination, size_t framesToProcess);
+#endif
+ };
 };
 
 }  // namespace blink
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp
index 8f3592cd7..ba9fc1a73 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.cpp
@@ -23,6 +23,9 @@
  * DAMAGE.
  */
 
+// include this first to get it before the CPU() function-like macro
+#include "base/cpu.h"
+
 #include "platform/audio/VectorMath.h"
 #include "wtf/Assertions.h"
 #include "wtf/CPU.h"
@@ -33,10 +36,14 @@
 #include <Accelerate/Accelerate.h>
 #endif
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
 #include <emmintrin.h>
 #endif
 
+#if defined(BUILD_ONLY_THE_SSE2_PARTS) && !defined(__SSE2__)
+#error SSE2 parts must be built with -msse2
+#endif
+
 #if HAVE(ARM_NEON_INTRINSICS)
 #include <arm_neon.h>
 #endif
@@ -165,15 +172,30 @@ void vclip(const float* sourceP,
 }
 #else
 
+#ifdef BUILD_ONLY_THE_SSE2_PARTS
+namespace SSE2 {
+#endif
+
+#if CPU(X86) && !defined(__SSE2__)
+static base::CPU cpu;
+#endif
+
 void vsma(const float* sourceP,
           int sourceStride,
           const float* scale,
           float* destP,
           int destStride,
           size_t framesToProcess) {
-  int n = framesToProcess;
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::vsma(sourceP, sourceStride, scale, destP, destStride, framesToProcess);
+        return;
+    }
+#endif
+
+int n = framesToProcess;
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   if ((sourceStride == 1) && (destStride == 1)) {
     float k = *scale;
 
@@ -269,9 +291,16 @@ void vsmul(const float* sourceP,
            float* destP,
            int destStride,
            size_t framesToProcess) {
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::vsmul(sourceP, sourceStride, scale, destP, destStride, framesToProcess);
+        return;
+    }
+#endif
+
   int n = framesToProcess;
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   if ((sourceStride == 1) && (destStride == 1)) {
     float k = *scale;
 
@@ -360,7 +389,7 @@ void vsmul(const float* sourceP,
       sourceP += sourceStride;
       destP += destStride;
     }
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   }
 #endif
 }
@@ -372,9 +401,16 @@ void vadd(const float* source1P,
           float* destP,
           int destStride,
           size_t framesToProcess) {
-  int n = framesToProcess;
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::vadd(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess);
+        return;
+    }
+#endif
 
-#if CPU(X86) || CPU(X86_64)
+    int n = framesToProcess;
+
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   if ((sourceStride1 == 1) && (sourceStride2 == 1) && (destStride == 1)) {
     // If the sourceP address is not 16-byte aligned, the first several frames
     // (at most three) should be processed separately.
@@ -501,7 +537,7 @@ void vadd(const float* source1P,
       source2P += sourceStride2;
       destP += destStride;
     }
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   }
 #endif
 }
@@ -513,9 +549,16 @@ void vmul(const float* source1P,
           float* destP,
           int destStride,
           size_t framesToProcess) {
-  int n = framesToProcess;
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::vmul(source1P, sourceStride1, source2P, sourceStride2, destP, destStride, framesToProcess);
+        return;
+    }
+#endif
+
+int n = framesToProcess;
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   if ((sourceStride1 == 1) && (sourceStride2 == 1) && (destStride == 1)) {
     // If the source1P address is not 16-byte aligned, the first several frames
     // (at most three) should be processed separately.
@@ -614,8 +657,15 @@ void zvmul(const float* real1P,
            float* realDestP,
            float* imagDestP,
            size_t framesToProcess) {
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::zvmul(real1P, imag1P, real2P, imag2P, realDestP, imagDestP, framesToProcess);
+        return;
+    }
+#endif
+
   unsigned i = 0;
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   // Only use the SSE optimization in the very common case that all addresses
   // are 16-byte aligned.  Otherwise, fall through to the scalar code below.
   if (!(reinterpret_cast<uintptr_t>(real1P) & 0x0F) &&
@@ -671,10 +721,17 @@ void vsvesq(const float* sourceP,
             int sourceStride,
             float* sumP,
             size_t framesToProcess) {
-  int n = framesToProcess;
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::vsvesq(sourceP, sourceStride, sumP, framesToProcess);
+        return;
+    }
+#endif
+
+    int n = framesToProcess;
   float sum = 0;
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   if (sourceStride == 1) {
     // If the sourceP address is not 16-byte aligned, the first several frames
     // (at most three) should be processed separately.
@@ -740,10 +797,16 @@ void vmaxmgv(const float* sourceP,
              int sourceStride,
              float* maxP,
              size_t framesToProcess) {
+#if CPU(X86) && !defined(__SSE2__)
+    if (cpu.has_sse2()) {
+        blink::VectorMath::SSE2::vmaxmgv(sourceP, sourceStride, maxP, framesToProcess);
+        return;
+    }
+#endif
   int n = framesToProcess;
   float max = 0;
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   if (sourceStride == 1) {
     // If the sourceP address is not 16-byte aligned, the first several frames
     // (at most three) should be processed separately.
@@ -839,6 +902,7 @@ void vclip(const float* sourceP,
            float* destP,
            int destStride,
            size_t framesToProcess) {
+#ifndef BUILD_ONLY_THE_SSE2_PARTS
   int n = framesToProcess;
   float lowThreshold = *lowThresholdP;
   float highThreshold = *highThresholdP;
@@ -888,6 +952,11 @@ void vclip(const float* sourceP,
     destP += destStride;
   }
 }
+#endif
+
+#ifdef BUILD_ONLY_THE_SSE2_PARTS
+} // namespace SSE2
+#endif
 
 #endif  // OS(MACOSX)
 
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h
index 8f375071c..d92e5b85e 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/audio/VectorMath.h
@@ -27,6 +27,7 @@
 #define VectorMath_h
 
 #include "platform/PlatformExport.h"
+#include "wtf/CPU.h"
 #include "wtf/build_config.h"
 #include <cstddef>
 
@@ -97,6 +98,28 @@ PLATFORM_EXPORT void vclip(const float* sourceP,
                            int destStride,
                            size_t framesToProcess);
 
+#if CPU(X86)
+namespace SSE2 {
+// Vector scalar multiply and then add.
+PLATFORM_EXPORT void vsma(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess);
+
+PLATFORM_EXPORT void vsmul(const float* sourceP, int sourceStride, const float* scale, float* destP, int destStride, size_t framesToProcess);
+PLATFORM_EXPORT void vadd(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess);
+
+// Finds the maximum magnitude of a float vector.
+PLATFORM_EXPORT void vmaxmgv(const float* sourceP, int sourceStride, float* maxP, size_t framesToProcess);
+
+// Sums the squares of a float vector's elements.
+PLATFORM_EXPORT void vsvesq(const float* sourceP, int sourceStride, float* sumP, size_t framesToProcess);
+
+// For an element-by-element multiply of two float vectors.
+PLATFORM_EXPORT void vmul(const float* source1P, int sourceStride1, const float* source2P, int sourceStride2, float* destP, int destStride, size_t framesToProcess);
+
+// Multiplies two complex vectors.
+PLATFORM_EXPORT void zvmul(const float* real1P, const float* imag1P, const float* real2P, const float* imag2P, float* realDestP, float* imagDestP, size_t framesToProcess);
+}
+#endif
+
 }  // namespace VectorMath
 }  // namespace blink
 
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h b/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h
index e30fcb464..4b3437057 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/cpu/x86/WebGLImageConversionSSE.h
@@ -5,7 +5,7 @@
 #ifndef WebGLImageConversionSSE_h
 #define WebGLImageConversionSSE_h
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
 
 #include <emmintrin.h>
 
diff --git a/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp b/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
index be417ea88..e79034424 100644
--- a/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
+++ b/src/3rdparty/chromium/third_party/WebKit/Source/platform/graphics/gpu/WebGLImageConversion.cpp
@@ -441,7 +441,7 @@ void unpack<WebGLImageConversion::DataFormatBGRA8, uint8_t, uint8_t>(
   const uint32_t* source32 = reinterpret_cast_ptr<const uint32_t*>(source);
   uint32_t* destination32 = reinterpret_cast_ptr<uint32_t*>(destination);
 
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   SIMD::unpackOneRowOfBGRA8LittleToRGBA8(source32, destination32, pixelsPerRow);
 #endif
 #if HAVE(MIPS_MSA_INTRINSICS)
@@ -467,7 +467,7 @@ void unpack<WebGLImageConversion::DataFormatRGBA5551, uint16_t, uint8_t>(
     const uint16_t* source,
     uint8_t* destination,
     unsigned pixelsPerRow) {
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   SIMD::unpackOneRowOfRGBA5551LittleToRGBA8(source, destination, pixelsPerRow);
 #endif
 #if HAVE(ARM_NEON_INTRINSICS)
@@ -496,7 +496,7 @@ void unpack<WebGLImageConversion::DataFormatRGBA4444, uint16_t, uint8_t>(
     const uint16_t* source,
     uint8_t* destination,
     unsigned pixelsPerRow) {
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   SIMD::unpackOneRowOfRGBA4444LittleToRGBA8(source, destination, pixelsPerRow);
 #endif
 #if HAVE(ARM_NEON_INTRINSICS)
@@ -711,7 +711,7 @@ void pack<WebGLImageConversion::DataFormatR8,
           uint8_t>(const uint8_t* source,
                    uint8_t* destination,
                    unsigned pixelsPerRow) {
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   SIMD::packOneRowOfRGBA8LittleToR8(source, destination, pixelsPerRow);
 #endif
 #if HAVE(MIPS_MSA_INTRINSICS)
@@ -768,7 +768,7 @@ void pack<WebGLImageConversion::DataFormatRA8,
           uint8_t>(const uint8_t* source,
                    uint8_t* destination,
                    unsigned pixelsPerRow) {
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   SIMD::packOneRowOfRGBA8LittleToRA8(source, destination, pixelsPerRow);
 #endif
 #if HAVE(MIPS_MSA_INTRINSICS)
@@ -880,7 +880,7 @@ void pack<WebGLImageConversion::DataFormatRGBA8,
           uint8_t>(const uint8_t* source,
                    uint8_t* destination,
                    unsigned pixelsPerRow) {
-#if CPU(X86) || CPU(X86_64)
+#if (CPU(X86) && defined(__SSE2__)) || CPU(X86_64)
   SIMD::packOneRowOfRGBA8LittleToRGBA8(source, destination, pixelsPerRow);
 #endif
 #if HAVE(MIPS_MSA_INTRINSICS)
diff --git a/src/3rdparty/chromium/third_party/qcms/BUILD.gn b/src/3rdparty/chromium/third_party/qcms/BUILD.gn
index 1183569be..771dd02c8 100644
--- a/src/3rdparty/chromium/third_party/qcms/BUILD.gn
+++ b/src/3rdparty/chromium/third_party/qcms/BUILD.gn
@@ -30,8 +30,8 @@ static_library("qcms") {
     ]
 
     if (current_cpu == "x86" || current_cpu == "x64") {
-      defines = [ "SSE2_ENABLE" ]
-      sources += [ "src/transform-sse2.c" ]
+      defines = [ "SSE2_ENABLE" ]  # runtime detection
+      deps = [ "qcms_sse2" ]
     }
   }
 
@@ -74,3 +74,16 @@ if (!disable_qcms) {
     public_configs = [ ":qcms_config" ]
   }
 }
+
+source_set("qcms_sse2") {
+  configs -= [ "//build/config/compiler:chromium_code" ]
+  configs += [ "//build/config/compiler:no_chromium_code" ]
+  public_configs = [ ":qcms_config" ]
+
+  if (current_cpu == "x86" || current_cpu == "x64") {
+    defines = [ "SSE2_ENABLE" ]
+    sources = [ "src/transform-sse2.c" ]
+    cflags = [ "-msse2" ]
+  }
+}
+
diff --git a/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc b/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc
index e721346f3..ef5a4e4a7 100644
--- a/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc
+++ b/src/3rdparty/chromium/third_party/webrtc/common_audio/real_fourier.cc
@@ -14,6 +14,7 @@
 #include "webrtc/common_audio/real_fourier_ooura.h"
 #include "webrtc/common_audio/real_fourier_openmax.h"
 #include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"
+#include "webrtc/system_wrappers/include/cpu_features_wrapper.h"
 
 namespace webrtc {
 
@@ -23,7 +24,15 @@ const size_t RealFourier::kFftBufferAlignment = 32;
 
 std::unique_ptr<RealFourier> RealFourier::Create(int fft_order) {
 #if defined(RTC_USE_OPENMAX_DL)
+#if defined(WEBRTC_ARCH_X86_FAMILY) && !defined(__SSE2__)
+  // x86 CPU detection required.
+  if (WebRtc_GetCPUInfo(kSSE2))
+    return std::unique_ptr<RealFourier>(new RealFourierOpenmax(fft_order));
+  else
+    return std::unique_ptr<RealFourier>(new RealFourierOoura(fft_order));
+#else
   return std::unique_ptr<RealFourier>(new RealFourierOpenmax(fft_order));
+#endif
 #else
   return std::unique_ptr<RealFourier>(new RealFourierOoura(fft_order));
 #endif
diff --git a/src/3rdparty/chromium/v8/BUILD.gn b/src/3rdparty/chromium/v8/BUILD.gn
index 9b209dfff..d88261d53 100644
--- a/src/3rdparty/chromium/v8/BUILD.gn
+++ b/src/3rdparty/chromium/v8/BUILD.gn
@@ -1769,43 +1769,41 @@ v8_static_library("v8_base") {
 
   if (v8_current_cpu == "x86") {
     sources += [  ### gcmole(arch:ia32) ###
-      "src/builtins/ia32/builtins-ia32.cc",
-      "src/compiler/ia32/code-generator-ia32.cc",
-      "src/compiler/ia32/instruction-codes-ia32.h",
-      "src/compiler/ia32/instruction-scheduler-ia32.cc",
-      "src/compiler/ia32/instruction-selector-ia32.cc",
-      "src/crankshaft/ia32/lithium-codegen-ia32.cc",
-      "src/crankshaft/ia32/lithium-codegen-ia32.h",
-      "src/crankshaft/ia32/lithium-gap-resolver-ia32.cc",
-      "src/crankshaft/ia32/lithium-gap-resolver-ia32.h",
-      "src/crankshaft/ia32/lithium-ia32.cc",
-      "src/crankshaft/ia32/lithium-ia32.h",
-      "src/debug/ia32/debug-ia32.cc",
-      "src/full-codegen/ia32/full-codegen-ia32.cc",
-      "src/ia32/assembler-ia32-inl.h",
-      "src/ia32/assembler-ia32.cc",
-      "src/ia32/assembler-ia32.h",
-      "src/ia32/code-stubs-ia32.cc",
-      "src/ia32/code-stubs-ia32.h",
-      "src/ia32/codegen-ia32.cc",
-      "src/ia32/codegen-ia32.h",
-      "src/ia32/cpu-ia32.cc",
-      "src/ia32/deoptimizer-ia32.cc",
-      "src/ia32/disasm-ia32.cc",
-      "src/ia32/frames-ia32.cc",
-      "src/ia32/frames-ia32.h",
-      "src/ia32/interface-descriptors-ia32.cc",
-      "src/ia32/macro-assembler-ia32.cc",
-      "src/ia32/macro-assembler-ia32.h",
-      "src/ia32/simulator-ia32.cc",
-      "src/ia32/simulator-ia32.h",
-      "src/ic/ia32/access-compiler-ia32.cc",
-      "src/ic/ia32/handler-compiler-ia32.cc",
-      "src/ic/ia32/ic-compiler-ia32.cc",
-      "src/ic/ia32/ic-ia32.cc",
-      "src/ic/ia32/stub-cache-ia32.cc",
-      "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
-      "src/regexp/ia32/regexp-macro-assembler-ia32.h",
+      "src/compiler/x87/code-generator-x87.cc",
+      "src/compiler/x87/instruction-codes-x87.h",
+      "src/compiler/x87/instruction-scheduler-x87.cc",
+      "src/compiler/x87/instruction-selector-x87.cc",
+      "src/crankshaft/x87/lithium-codegen-x87.cc",
+      "src/crankshaft/x87/lithium-codegen-x87.h",
+      "src/crankshaft/x87/lithium-gap-resolver-x87.cc",
+      "src/crankshaft/x87/lithium-gap-resolver-x87.h",
+      "src/crankshaft/x87/lithium-x87.cc",
+      "src/crankshaft/x87/lithium-x87.h",
+      "src/debug/x87/debug-x87.cc",
+      "src/full-codegen/x87/full-codegen-x87.cc",
+      "src/x87/assembler-x87-inl.h",
+      "src/x87/assembler-x87.cc",
+      "src/x87/assembler-x87.h",
+      "src/x87/builtins-x87.cc",
+      "src/x87/code-stubs-x87.cc",
+      "src/x87/code-stubs-x87.h",
+      "src/x87/codegen-x87.cc",
+      "src/x87/codegen-x87.h",
+      "src/x87/cpu-x87.cc",
+      "src/x87/deoptimizer-x87.cc",
+      "src/x87/disasm-x87.cc",
+      "src/x87/frames-x87.cc",
+      "src/x87/frames-x87.h",
+      "src/x87/interface-descriptors-x87.cc",
+      "src/x87/macro-assembler-x87.cc",
+      "src/x87/macro-assembler-x87.h",
+      "src/ic/x87/access-compiler-x87.cc",
+      "src/ic/x87/handler-compiler-x87.cc",
+      "src/ic/x87/ic-compiler-x87.cc",
+      "src/ic/x87/ic-x87.cc",
+      "src/ic/x87/stub-cache-x87.cc",
+      "src/regexp/x87/regexp-macro-assembler-x87.cc",
+      "src/regexp/x87/regexp-macro-assembler-x87.h",
     ]
   } else if (v8_current_cpu == "x64") {
     sources += [  ### gcmole(arch:x64) ###
diff --git a/src/3rdparty/chromium/v8/src/make-v8-sse2-gyp.sh b/src/3rdparty/chromium/v8/src/make-v8-sse2-gyp.sh
new file mode 100644
index 000000000..0e7ec1621
--- /dev/null
+++ b/src/3rdparty/chromium/v8/src/make-v8-sse2-gyp.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# This script renames the v8 targets to _sse2 names so that they do not conflict
+# with the non-SSE2 versions.
+
+# Copyright 2016 Kevin Kofler. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Google Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# 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.
+
+# add comment noting that the file is generated
+echo "# Generated from v8.gyp by make-v8-sse2-gyp.sh" >v8_sse2.gyp
+# rename all target names
+SUBTARGETS=`grep "'target_name': '" v8.gyp | sed -e "s/^.*'target_name': '//g" -e "s/',$//g"`
+SEDS=
+for SUBTARGET in $SUBTARGETS ; do
+  SEDS=$SEDS\ -e\ "s/'$SUBTARGET\(['#]\)/'${SUBTARGET}_sse2\1/g"
+done
+# in addition:
+# * set v8_target_arch to "ia32" (instead of "x87")
+# * rename all actions
+# * fix mksnapshot_exec to match the renamed target
+# * rename the generated snapshot.cc (but not mksnapshot.cc) to snapshot_sse2.cc
+# * rename the generated *libraries.cc to *libraries_sse2.cc
+# * rename the generated *.bin to *_sse2.bin
+# * set product_name and product_dir for the v8_sse2 target
+sed -e "s/^\(  'variables': {\)/\1\n    'v8_target_arch': 'ia32',/g" \
+    -e "s/\('action_name': '\)/\1v8_sse2_/g" \
+    $SEDS \
+    -e "s/\('mksnapshot_exec': '.*mksnapshot\)/\1_sse2/g" \
+    -e "s#/snapshot\.cc#/snapshot_sse2.cc#g" \
+    -e "s/libraries\.cc/libraries_sse2.cc/g" \
+    -e "s/\.bin/_sse2.bin/g" \
+    -e "s#^\( *\)\('target_name': 'v8_sse2',\)#\1\2\n\1'product_name': 'v8',\n\1'product_dir': '<(PRODUCT_DIR)/lib/sse2',#g" \
+    v8.gyp >>v8_sse2.gyp
diff --git a/src/3rdparty/chromium/v8/src/v8.gyp b/src/3rdparty/chromium/v8/src/v8.gyp
index 020ec0928..2add932fc 100644
--- a/src/3rdparty/chromium/v8/src/v8.gyp
+++ b/src/3rdparty/chromium/v8/src/v8.gyp
@@ -51,8 +51,8 @@
         }, {
           'toolsets': ['target'],
         }],
-        ['component=="shared_library"', {
-          'type': '<(component)',
+        ['v8_component=="shared_library"', {
+          'type': '<(v8_component)',
           'sources': [
             # Note: on non-Windows we still build this file so that gyp
             # has some sources to link into the component.
@@ -151,7 +151,7 @@
             'js2c',
           ],
         }],
-        ['component=="shared_library"', {
+        ['v8_component=="shared_library"', {
           'defines': [
             'BUILDING_V8_SHARED',
           ],
@@ -243,7 +243,7 @@
           'toolsets': ['target'],
           'dependencies': ['js2c'],
         }],
-        ['component=="shared_library"', {
+        ['v8_component=="shared_library"', {
           'defines': [
             'BUILDING_V8_SHARED',
           ],
@@ -270,7 +270,7 @@
                 'natives_blob',
               ],
             }],
-            ['component=="shared_library"', {
+            ['v8_component=="shared_library"', {
               'defines': [
                 'BUILDING_V8_SHARED',
               ],
@@ -1727,7 +1727,7 @@
           # See http://crbug.com/485155.
           'msvs_shard': 4,
         }],
-        ['component=="shared_library"', {
+        ['v8_component=="shared_library"', {
           'defines': [
             'BUILDING_V8_SHARED',
           ],
diff --git a/src/3rdparty/chromium/v8/src/v8_sse2.gyp b/src/3rdparty/chromium/v8/src/v8_sse2.gyp
new file mode 100644
index 000000000..140b071a6
--- /dev/null
+++ b/src/3rdparty/chromium/v8/src/v8_sse2.gyp
@@ -0,0 +1,2313 @@
+# Generated from v8.gyp by make-v8-sse2-gyp.sh
+# Copyright 2012 the V8 project authors. All rights reserved.
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+#       notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+#       copyright notice, this list of conditions and the following
+#       disclaimer in the documentation and/or other materials provided
+#       with the distribution.
+#     * Neither the name of Google Inc. nor the names of its
+#       contributors may be used to endorse or promote products derived
+#       from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# 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.
+
+{
+  'variables': {
+    'v8_target_arch': 'ia32',
+    'v8_code': 1,
+    'v8_random_seed%': 314159265,
+    'v8_vector_stores%': 0,
+    'embed_script%': "",
+    'warmup_script%': "",
+    'v8_extra_library_files%': [],
+    'v8_experimental_extra_library_files%': [],
+    'mksnapshot_exec': '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)mksnapshot_sse2<(EXECUTABLE_SUFFIX)',
+    'remove_v8base_debug_symbols%': 0,
+    'conditions': [
+      # build V8 shared on ia32 so we can swap x87 vs. SSE2 builds
+      ['target_arch == "ia32"', {
+        'v8_component%': 'shared_library',
+      }, {
+        'v8_component%': '<(component)',
+      }],
+    ],
+  },
+  'includes': ['../gypfiles/toolchain.gypi', '../gypfiles/features.gypi'],
+  'targets': [
+    {
+      'target_name': 'v8_sse2',
+      'product_name': 'v8',
+      'product_dir': '<(PRODUCT_DIR)/lib/sse2',
+      'dependencies_traverse': 1,
+      'dependencies': ['v8_maybe_snapshot_sse2'],
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+        ['v8_component=="shared_library"', {
+          'type': '<(v8_component)',
+          'sources': [
+            # Note: on non-Windows we still build this file so that gyp
+            # has some sources to link into the component.
+            'v8dll-main.cc',
+          ],
+          'include_dirs': [
+            '..',
+          ],
+          'defines': [
+            'V8_SHARED',
+            'BUILDING_V8_SHARED',
+          ],
+          'direct_dependent_settings': {
+            'defines': [
+              'V8_SHARED',
+              'USING_V8_SHARED',
+            ],
+          },
+          'target_conditions': [
+            ['OS=="android" and _toolset=="target"', {
+              'libraries': [
+                '-llog',
+              ],
+              'include_dirs': [
+                'src/common/android/include',
+              ],
+            }],
+          ],
+          'conditions': [
+            ['OS=="mac"', {
+              'xcode_settings': {
+                'OTHER_LDFLAGS': ['-dynamiclib', '-all_load']
+              },
+            }],
+            ['soname_version!=""', {
+              'product_extension': 'so.<(soname_version)',
+            }],
+          ],
+        },
+        {
+          'type': 'none',
+        }],
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '../include',
+        ],
+      },
+    },
+    {
+      # This rule delegates to either v8_snapshot, v8_nosnapshot, or
+      # v8_external_snapshot, depending on the current variables.
+      # The intention is to make the 'calling' rules a bit simpler.
+      'target_name': 'v8_maybe_snapshot_sse2',
+      'type': 'none',
+      'conditions': [
+        ['v8_use_snapshot!="true"', {
+          # The dependency on v8_base should come from a transitive
+          # dependency however the Android toolchain requires libv8_base.a
+          # to appear before libv8_snapshot.a so it's listed explicitly.
+          'dependencies': ['v8_base_sse2', 'v8_nosnapshot_sse2'],
+        }],
+        ['v8_use_snapshot=="true" and v8_use_external_startup_data==0', {
+          # The dependency on v8_base should come from a transitive
+          # dependency however the Android toolchain requires libv8_base.a
+          # to appear before libv8_snapshot.a so it's listed explicitly.
+          'dependencies': ['v8_base_sse2', 'v8_snapshot_sse2'],
+        }],
+        ['v8_use_snapshot=="true" and v8_use_external_startup_data==1 and want_separate_host_toolset==0', {
+          'dependencies': ['v8_base_sse2', 'v8_external_snapshot_sse2'],
+          'inputs': [ '<(PRODUCT_DIR)/snapshot_blob_sse2.bin', ],
+        }],
+        ['v8_use_snapshot=="true" and v8_use_external_startup_data==1 and want_separate_host_toolset==1', {
+          'dependencies': ['v8_base_sse2', 'v8_external_snapshot_sse2'],
+          'target_conditions': [
+            ['_toolset=="host"', {
+              'inputs': [
+                '<(PRODUCT_DIR)/snapshot_blob_host_sse2.bin',
+              ],
+            }, {
+              'inputs': [
+                '<(PRODUCT_DIR)/snapshot_blob_sse2.bin',
+              ],
+            }],
+          ],
+        }],
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ]
+    },
+    {
+      'target_name': 'v8_snapshot_sse2',
+      'type': 'static_library',
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+          'dependencies': [
+            'mksnapshot_sse2#host',
+            'js2c_sse2#host',
+          ],
+        }, {
+          'toolsets': ['target'],
+          'dependencies': [
+            'mksnapshot_sse2',
+            'js2c_sse2',
+          ],
+        }],
+        ['v8_component=="shared_library"', {
+          'defines': [
+            'V8_SHARED',
+            'BUILDING_V8_SHARED',
+          ],
+          'direct_dependent_settings': {
+            'defines': [
+              'V8_SHARED',
+              'USING_V8_SHARED',
+            ],
+          },
+        }],
+      ],
+      'dependencies': [
+        'v8_base_sse2',
+      ],
+      'include_dirs+': [
+        '..',
+      ],
+      'sources': [
+        '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc',
+        '<(INTERMEDIATE_DIR)/snapshot_sse2.cc',
+      ],
+      'actions': [
+        {
+          'action_name': 'v8_sse2_run_mksnapshot',
+          'inputs': [
+            '<(mksnapshot_exec)',
+          ],
+          'conditions': [
+            ['embed_script!=""', {
+              'inputs': [
+                '<(embed_script)',
+              ],
+            }],
+            ['warmup_script!=""', {
+              'inputs': [
+                '<(warmup_script)',
+              ],
+            }],
+          ],
+          'outputs': [
+            '<(INTERMEDIATE_DIR)/snapshot_sse2.cc',
+          ],
+          'variables': {
+            'mksnapshot_flags': [],
+            'conditions': [
+              ['v8_random_seed!=0', {
+                'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
+              }],
+              ['v8_vector_stores!=0', {
+                'mksnapshot_flags': ['--vector-stores'],
+              }],
+            ],
+          },
+          'action': [
+            '<(mksnapshot_exec)',
+            '<@(mksnapshot_flags)',
+            '--startup_src', '<@(INTERMEDIATE_DIR)/snapshot_sse2.cc',
+            '<(embed_script)',
+            '<(warmup_script)',
+          ],
+        },
+      ],
+    },
+    {
+      'target_name': 'v8_nosnapshot_sse2',
+      'type': 'static_library',
+      'dependencies': [
+        'v8_base_sse2',
+      ],
+      'include_dirs+': [
+        '..',
+      ],
+      'sources': [
+        '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc',
+        '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc',
+        'snapshot/snapshot-empty.cc',
+      ],
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+          'dependencies': ['js2c_sse2#host'],
+        }, {
+          'toolsets': ['target'],
+          'dependencies': ['js2c_sse2'],
+        }],
+        ['v8_component=="shared_library"', {
+          'defines': [
+            'BUILDING_V8_SHARED',
+            'V8_SHARED',
+          ],
+        }],
+      ]
+    },
+    {
+      'target_name': 'v8_external_snapshot_sse2',
+      'type': 'static_library',
+      'conditions': [
+        [ 'v8_use_external_startup_data==1', {
+          'conditions': [
+            ['want_separate_host_toolset==1', {
+              'toolsets': ['host', 'target'],
+              'dependencies': [
+                'mksnapshot_sse2#host',
+                'js2c_sse2#host',
+                'natives_blob_sse2',
+            ]}, {
+              'toolsets': ['target'],
+              'dependencies': [
+                'mksnapshot_sse2',
+                'js2c_sse2',
+                'natives_blob_sse2',
+              ],
+            }],
+            ['v8_component=="shared_library"', {
+              'defines': [
+                'V8_SHARED',
+                'BUILDING_V8_SHARED',
+              ],
+              'direct_dependent_settings': {
+                'defines': [
+                  'V8_SHARED',
+                  'USING_V8_SHARED',
+                ],
+              },
+            }],
+          ],
+          'dependencies': [
+            'v8_base_sse2',
+          ],
+          'include_dirs+': [
+            '..',
+          ],
+          'sources': [
+            'snapshot/natives-external.cc',
+            'snapshot/snapshot-external.cc',
+          ],
+          'actions': [
+            {
+              'action_name': 'v8_sse2_run_mksnapshot (external)',
+              'inputs': [
+                '<(mksnapshot_exec)',
+              ],
+              'variables': {
+                'mksnapshot_flags': [],
+                'conditions': [
+                  ['v8_random_seed!=0', {
+                    'mksnapshot_flags': ['--random-seed', '<(v8_random_seed)'],
+                  }],
+                  ['v8_vector_stores!=0', {
+                    'mksnapshot_flags': ['--vector-stores'],
+                  }],
+                ],
+              },
+              'conditions': [
+                ['embed_script!=""', {
+                  'inputs': [
+                    '<(embed_script)',
+                  ],
+                }],
+                ['warmup_script!=""', {
+                  'inputs': [
+                    '<(warmup_script)',
+                  ],
+                }],
+                ['want_separate_host_toolset==1', {
+                  'target_conditions': [
+                    ['_toolset=="host"', {
+                      'outputs': [
+                        '<(PRODUCT_DIR)/snapshot_blob_host_sse2.bin',
+                      ],
+                      'action': [
+                        '<(mksnapshot_exec)',
+                        '<@(mksnapshot_flags)',
+                        '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_host_sse2.bin',
+                        '<(embed_script)',
+                        '<(warmup_script)',
+                      ],
+                    }, {
+                      'outputs': [
+                        '<(PRODUCT_DIR)/snapshot_blob_sse2.bin',
+                      ],
+                      'action': [
+                        '<(mksnapshot_exec)',
+                        '<@(mksnapshot_flags)',
+                        '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_sse2.bin',
+                        '<(embed_script)',
+                        '<(warmup_script)',
+                      ],
+                    }],
+                  ],
+                }, {
+                  'outputs': [
+                    '<(PRODUCT_DIR)/snapshot_blob_sse2.bin',
+                  ],
+                  'action': [
+                    '<(mksnapshot_exec)',
+                    '<@(mksnapshot_flags)',
+                    '--startup_blob', '<(PRODUCT_DIR)/snapshot_blob_sse2.bin',
+                    '<(embed_script)',
+                    '<(warmup_script)',
+                  ],
+                }],
+              ],
+            },
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'v8_base_sse2',
+      'type': 'static_library',
+      'dependencies': [
+        'v8_libbase_sse2',
+        'v8_libsampler_sse2',
+      ],
+      'variables': {
+        'optimize': 'max',
+      },
+      'include_dirs+': [
+        '..',
+        '<(DEPTH)',
+      ],
+      'sources': [  ### gcmole(all) ###
+        '../include/v8-debug.h',
+        '../include/v8-experimental.h',
+        '../include/v8-platform.h',
+        '../include/v8-profiler.h',
+        '../include/v8-testing.h',
+        '../include/v8-util.h',
+        '../include/v8-version.h',
+        '../include/v8.h',
+        '../include/v8config.h',
+        'accessors.cc',
+        'accessors.h',
+        'address-map.cc',
+        'address-map.h',
+        'allocation.cc',
+        'allocation.h',
+        'allocation-site-scopes.cc',
+        'allocation-site-scopes.h',
+        'api-experimental.cc',
+        'api-experimental.h',
+        'api.cc',
+        'api.h',
+        'api-arguments-inl.h',
+        'api-arguments.cc',
+        'api-arguments.h',
+        'api-natives.cc',
+        'api-natives.h',
+        'arguments.cc',
+        'arguments.h',
+        'assembler.cc',
+        'assembler.h',
+        'assert-scope.h',
+        'assert-scope.cc',
+        'ast/ast-expression-rewriter.cc',
+        'ast/ast-expression-rewriter.h',
+        'ast/ast-expression-visitor.cc',
+        'ast/ast-expression-visitor.h',
+        'ast/ast-literal-reindexer.cc',
+        'ast/ast-literal-reindexer.h',
+        'ast/ast-numbering.cc',
+        'ast/ast-numbering.h',
+        'ast/ast-type-bounds.h',
+        'ast/ast-value-factory.cc',
+        'ast/ast-value-factory.h',
+        'ast/ast.cc',
+        'ast/ast.h',
+        'ast/modules.cc',
+        'ast/modules.h',
+        'ast/prettyprinter.cc',
+        'ast/prettyprinter.h',
+        'ast/scopeinfo.cc',
+        'ast/scopeinfo.h',
+        'ast/scopes.cc',
+        'ast/scopes.h',
+        'ast/variables.cc',
+        'ast/variables.h',
+        'background-parsing-task.cc',
+        'background-parsing-task.h',
+        'bailout-reason.cc',
+        'bailout-reason.h',
+        'basic-block-profiler.cc',
+        'basic-block-profiler.h',
+        'bignum-dtoa.cc',
+        'bignum-dtoa.h',
+        'bignum.cc',
+        'bignum.h',
+        'bit-vector.cc',
+        'bit-vector.h',
+        'bootstrapper.cc',
+        'bootstrapper.h',
+        'builtins.cc',
+        'builtins.h',
+        'cached-powers.cc',
+        'cached-powers.h',
+        'cancelable-task.cc',
+        'cancelable-task.h',
+        'char-predicates.cc',
+        'char-predicates-inl.h',
+        'char-predicates.h',
+        'checks.h',
+        'code-events.h',
+        'code-factory.cc',
+        'code-factory.h',
+        'code-stub-assembler.cc',
+        'code-stub-assembler.h',
+        'code-stubs.cc',
+        'code-stubs.h',
+        'code-stubs-hydrogen.cc',
+        'codegen.cc',
+        'codegen.h',
+        'collector.h',
+        'compilation-cache.cc',
+        'compilation-cache.h',
+        'compilation-dependencies.cc',
+        'compilation-dependencies.h',
+        'compilation-statistics.cc',
+        'compilation-statistics.h',
+        'compiler/access-builder.cc',
+        'compiler/access-builder.h',
+        'compiler/access-info.cc',
+        'compiler/access-info.h',
+        'compiler/all-nodes.cc',
+        'compiler/all-nodes.h',
+        'compiler/ast-graph-builder.cc',
+        'compiler/ast-graph-builder.h',
+        'compiler/ast-loop-assignment-analyzer.cc',
+        'compiler/ast-loop-assignment-analyzer.h',
+        'compiler/basic-block-instrumentor.cc',
+        'compiler/basic-block-instrumentor.h',
+        'compiler/branch-elimination.cc',
+        'compiler/branch-elimination.h',
+        'compiler/bytecode-branch-analysis.cc',
+        'compiler/bytecode-branch-analysis.h',
+        'compiler/bytecode-graph-builder.cc',
+        'compiler/bytecode-graph-builder.h',
+        'compiler/c-linkage.cc',
+        'compiler/checkpoint-elimination.cc',
+        'compiler/checkpoint-elimination.h',
+        'compiler/code-generator-impl.h',
+        'compiler/code-generator.cc',
+        'compiler/code-generator.h',
+        'compiler/code-assembler.cc',
+        'compiler/code-assembler.h',
+        'compiler/common-node-cache.cc',
+        'compiler/common-node-cache.h',
+        'compiler/common-operator-reducer.cc',
+        'compiler/common-operator-reducer.h',
+        'compiler/common-operator.cc',
+        'compiler/common-operator.h',
+        'compiler/control-builders.cc',
+        'compiler/control-builders.h',
+        'compiler/control-equivalence.cc',
+        'compiler/control-equivalence.h',
+        'compiler/control-flow-optimizer.cc',
+        'compiler/control-flow-optimizer.h',
+        'compiler/dead-code-elimination.cc',
+        'compiler/dead-code-elimination.h',
+        'compiler/diamond.h',
+        'compiler/effect-control-linearizer.cc',
+        'compiler/effect-control-linearizer.h',
+        'compiler/escape-analysis.cc',
+        'compiler/escape-analysis.h',
+        "compiler/escape-analysis-reducer.cc",
+        "compiler/escape-analysis-reducer.h",
+        'compiler/frame.cc',
+        'compiler/frame.h',
+        'compiler/frame-elider.cc',
+        'compiler/frame-elider.h',
+        "compiler/frame-states.cc",
+        "compiler/frame-states.h",
+        'compiler/gap-resolver.cc',
+        'compiler/gap-resolver.h',
+        'compiler/graph-reducer.cc',
+        'compiler/graph-reducer.h',
+        'compiler/graph-replay.cc',
+        'compiler/graph-replay.h',
+        'compiler/graph-trimmer.cc',
+        'compiler/graph-trimmer.h',
+        'compiler/graph-visualizer.cc',
+        'compiler/graph-visualizer.h',
+        'compiler/graph.cc',
+        'compiler/graph.h',
+        'compiler/instruction-codes.h',
+        'compiler/instruction-selector-impl.h',
+        'compiler/instruction-selector.cc',
+        'compiler/instruction-selector.h',
+        'compiler/instruction-scheduler.cc',
+        'compiler/instruction-scheduler.h',
+        'compiler/instruction.cc',
+        'compiler/instruction.h',
+        'compiler/int64-lowering.cc',
+        'compiler/int64-lowering.h',
+        'compiler/js-builtin-reducer.cc',
+        'compiler/js-builtin-reducer.h',
+        'compiler/js-call-reducer.cc',
+        'compiler/js-call-reducer.h',
+        'compiler/js-context-specialization.cc',
+        'compiler/js-context-specialization.h',
+        'compiler/js-create-lowering.cc',
+        'compiler/js-create-lowering.h',
+        'compiler/js-frame-specialization.cc',
+        'compiler/js-frame-specialization.h',
+        'compiler/js-generic-lowering.cc',
+        'compiler/js-generic-lowering.h',
+        'compiler/js-global-object-specialization.cc',
+        'compiler/js-global-object-specialization.h',
+        'compiler/js-graph.cc',
+        'compiler/js-graph.h',
+        'compiler/js-inlining.cc',
+        'compiler/js-inlining.h',
+        'compiler/js-inlining-heuristic.cc',
+        'compiler/js-inlining-heuristic.h',
+        'compiler/js-intrinsic-lowering.cc',
+        'compiler/js-intrinsic-lowering.h',
+        'compiler/js-native-context-specialization.cc',
+        'compiler/js-native-context-specialization.h',
+        'compiler/js-operator.cc',
+        'compiler/js-operator.h',
+        'compiler/js-typed-lowering.cc',
+        'compiler/js-typed-lowering.h',
+        'compiler/jump-threading.cc',
+        'compiler/jump-threading.h',
+        'compiler/linkage.cc',
+        'compiler/linkage.h',
+        'compiler/liveness-analyzer.cc',
+        'compiler/liveness-analyzer.h',
+        'compiler/live-range-separator.cc',
+        'compiler/live-range-separator.h',
+        'compiler/load-elimination.cc',
+        'compiler/load-elimination.h',
+        'compiler/loop-analysis.cc',
+        'compiler/loop-analysis.h',
+        'compiler/loop-peeling.cc',
+        'compiler/loop-peeling.h',
+        'compiler/machine-operator-reducer.cc',
+        'compiler/machine-operator-reducer.h',
+        'compiler/machine-operator.cc',
+        'compiler/machine-operator.h',
+        'compiler/memory-optimizer.cc',
+        'compiler/memory-optimizer.h',
+        'compiler/move-optimizer.cc',
+        'compiler/move-optimizer.h',
+        'compiler/node-aux-data.h',
+        'compiler/node-cache.cc',
+        'compiler/node-cache.h',
+        'compiler/node-marker.cc',
+        'compiler/node-marker.h',
+        'compiler/node-matchers.cc',
+        'compiler/node-matchers.h',
+        'compiler/node-properties.cc',
+        'compiler/node-properties.h',
+        'compiler/node.cc',
+        'compiler/node.h',
+        'compiler/opcodes.cc',
+        'compiler/opcodes.h',
+        'compiler/operation-typer.cc',
+        'compiler/operation-typer.h',
+        'compiler/operator-properties.cc',
+        'compiler/operator-properties.h',
+        'compiler/operator.cc',
+        'compiler/operator.h',
+        'compiler/osr.cc',
+        'compiler/osr.h',
+        'compiler/pipeline.cc',
+        'compiler/pipeline.h',
+        'compiler/pipeline-statistics.cc',
+        'compiler/pipeline-statistics.h',
+        'compiler/raw-machine-assembler.cc',
+        'compiler/raw-machine-assembler.h',
+        'compiler/redundancy-elimination.cc',
+        'compiler/redundancy-elimination.h',
+        'compiler/register-allocator.cc',
+        'compiler/register-allocator.h',
+        'compiler/register-allocator-verifier.cc',
+        'compiler/register-allocator-verifier.h',
+        'compiler/representation-change.cc',
+        'compiler/representation-change.h',
+        'compiler/schedule.cc',
+        'compiler/schedule.h',
+        'compiler/scheduler.cc',
+        'compiler/scheduler.h',
+        'compiler/select-lowering.cc',
+        'compiler/select-lowering.h',
+        'compiler/simplified-lowering.cc',
+        'compiler/simplified-lowering.h',
+        'compiler/simplified-operator-reducer.cc',
+        'compiler/simplified-operator-reducer.h',
+        'compiler/simplified-operator.cc',
+        'compiler/simplified-operator.h',
+        'compiler/source-position.cc',
+        'compiler/source-position.h',
+        'compiler/state-values-utils.cc',
+        'compiler/state-values-utils.h',
+        'compiler/store-store-elimination.cc',
+        'compiler/store-store-elimination.h',
+        'compiler/tail-call-optimization.cc',
+        'compiler/tail-call-optimization.h',
+        'compiler/type-hint-analyzer.cc',
+        'compiler/type-hint-analyzer.h',
+        'compiler/type-hints.cc',
+        'compiler/type-hints.h',
+        'compiler/typer.cc',
+        'compiler/typer.h',
+        'compiler/value-numbering-reducer.cc',
+        'compiler/value-numbering-reducer.h',
+        'compiler/verifier.cc',
+        'compiler/verifier.h',
+        'compiler/wasm-compiler.cc',
+        'compiler/wasm-compiler.h',
+        'compiler/wasm-linkage.cc',
+        'compiler/zone-pool.cc',
+        'compiler/zone-pool.h',
+        'compiler.cc',
+        'compiler.h',
+        'context-measure.cc',
+        'context-measure.h',
+        'contexts-inl.h',
+        'contexts.cc',
+        'contexts.h',
+        'conversions-inl.h',
+        'conversions.cc',
+        'conversions.h',
+        'counters-inl.h',
+        'counters.cc',
+        'counters.h',
+        'crankshaft/compilation-phase.cc',
+        'crankshaft/compilation-phase.h',
+        'crankshaft/hydrogen-alias-analysis.h',
+        'crankshaft/hydrogen-bce.cc',
+        'crankshaft/hydrogen-bce.h',
+        'crankshaft/hydrogen-canonicalize.cc',
+        'crankshaft/hydrogen-canonicalize.h',
+        'crankshaft/hydrogen-check-elimination.cc',
+        'crankshaft/hydrogen-check-elimination.h',
+        'crankshaft/hydrogen-dce.cc',
+        'crankshaft/hydrogen-dce.h',
+        'crankshaft/hydrogen-dehoist.cc',
+        'crankshaft/hydrogen-dehoist.h',
+        'crankshaft/hydrogen-environment-liveness.cc',
+        'crankshaft/hydrogen-environment-liveness.h',
+        'crankshaft/hydrogen-escape-analysis.cc',
+        'crankshaft/hydrogen-escape-analysis.h',
+        'crankshaft/hydrogen-flow-engine.h',
+        'crankshaft/hydrogen-gvn.cc',
+        'crankshaft/hydrogen-gvn.h',
+        'crankshaft/hydrogen-infer-representation.cc',
+        'crankshaft/hydrogen-infer-representation.h',
+        'crankshaft/hydrogen-infer-types.cc',
+        'crankshaft/hydrogen-infer-types.h',
+        'crankshaft/hydrogen-instructions.cc',
+        'crankshaft/hydrogen-instructions.h',
+        'crankshaft/hydrogen-load-elimination.cc',
+        'crankshaft/hydrogen-load-elimination.h',
+        'crankshaft/hydrogen-mark-deoptimize.cc',
+        'crankshaft/hydrogen-mark-deoptimize.h',
+        'crankshaft/hydrogen-mark-unreachable.cc',
+        'crankshaft/hydrogen-mark-unreachable.h',
+        'crankshaft/hydrogen-osr.cc',
+        'crankshaft/hydrogen-osr.h',
+        'crankshaft/hydrogen-range-analysis.cc',
+        'crankshaft/hydrogen-range-analysis.h',
+        'crankshaft/hydrogen-redundant-phi.cc',
+        'crankshaft/hydrogen-redundant-phi.h',
+        'crankshaft/hydrogen-removable-simulates.cc',
+        'crankshaft/hydrogen-removable-simulates.h',
+        'crankshaft/hydrogen-representation-changes.cc',
+        'crankshaft/hydrogen-representation-changes.h',
+        'crankshaft/hydrogen-sce.cc',
+        'crankshaft/hydrogen-sce.h',
+        'crankshaft/hydrogen-store-elimination.cc',
+        'crankshaft/hydrogen-store-elimination.h',
+        'crankshaft/hydrogen-types.cc',
+        'crankshaft/hydrogen-types.h',
+        'crankshaft/hydrogen-uint32-analysis.cc',
+        'crankshaft/hydrogen-uint32-analysis.h',
+        'crankshaft/hydrogen.cc',
+        'crankshaft/hydrogen.h',
+        'crankshaft/lithium-allocator-inl.h',
+        'crankshaft/lithium-allocator.cc',
+        'crankshaft/lithium-allocator.h',
+        'crankshaft/lithium-codegen.cc',
+        'crankshaft/lithium-codegen.h',
+        'crankshaft/lithium.cc',
+        'crankshaft/lithium.h',
+        'crankshaft/lithium-inl.h',
+        'crankshaft/typing.cc',
+        'crankshaft/typing.h',
+        'crankshaft/unique.h',
+        'date.cc',
+        'date.h',
+        'dateparser-inl.h',
+        'dateparser.cc',
+        'dateparser.h',
+        'debug/debug-evaluate.cc',
+        'debug/debug-evaluate.h',
+        'debug/debug-frames.cc',
+        'debug/debug-frames.h',
+        'debug/debug-scopes.cc',
+        'debug/debug-scopes.h',
+        'debug/debug.cc',
+        'debug/debug.h',
+        'debug/liveedit.cc',
+        'debug/liveedit.h',
+        'deoptimizer.cc',
+        'deoptimizer.h',
+        'disasm.h',
+        'disassembler.cc',
+        'disassembler.h',
+        'diy-fp.cc',
+        'diy-fp.h',
+        'double.h',
+        'dtoa.cc',
+        'dtoa.h',
+        'effects.h',
+        'eh-frame.cc',
+        'eh-frame.h',
+        'elements-kind.cc',
+        'elements-kind.h',
+        'elements.cc',
+        'elements.h',
+        'execution.cc',
+        'execution.h',
+        'extensions/externalize-string-extension.cc',
+        'extensions/externalize-string-extension.h',
+        'extensions/free-buffer-extension.cc',
+        'extensions/free-buffer-extension.h',
+        'extensions/gc-extension.cc',
+        'extensions/gc-extension.h',
+        'extensions/ignition-statistics-extension.cc',
+        'extensions/ignition-statistics-extension.h',
+        'extensions/statistics-extension.cc',
+        'extensions/statistics-extension.h',
+        'extensions/trigger-failure-extension.cc',
+        'extensions/trigger-failure-extension.h',
+        'external-reference-table.cc',
+        'external-reference-table.h',
+        'factory.cc',
+        'factory.h',
+        'fast-accessor-assembler.cc',
+        'fast-accessor-assembler.h',
+        'fast-dtoa.cc',
+        'fast-dtoa.h',
+        'field-index.h',
+        'field-index-inl.h',
+        'field-type.cc',
+        'field-type.h',
+        'fixed-dtoa.cc',
+        'fixed-dtoa.h',
+        'flag-definitions.h',
+        'flags.cc',
+        'flags.h',
+        'frames-inl.h',
+        'frames.cc',
+        'frames.h',
+        'full-codegen/full-codegen.cc',
+        'full-codegen/full-codegen.h',
+        'futex-emulation.cc',
+        'futex-emulation.h',
+        'gdb-jit.cc',
+        'gdb-jit.h',
+        'global-handles.cc',
+        'global-handles.h',
+        'globals.h',
+        'handles-inl.h',
+        'handles.cc',
+        'handles.h',
+        'heap-symbols.h',
+        'heap/array-buffer-tracker-inl.h',
+        'heap/array-buffer-tracker.cc',
+        'heap/array-buffer-tracker.h',
+        'heap/memory-reducer.cc',
+        'heap/memory-reducer.h',
+        'heap/gc-idle-time-handler.cc',
+        'heap/gc-idle-time-handler.h',
+        'heap/gc-tracer.cc',
+        'heap/gc-tracer.h',
+        'heap/heap-inl.h',
+        'heap/heap.cc',
+        'heap/heap.h',
+        'heap/incremental-marking-inl.h',
+        'heap/incremental-marking-job.cc',
+        'heap/incremental-marking-job.h',
+        'heap/incremental-marking.cc',
+        'heap/incremental-marking.h',
+        'heap/mark-compact-inl.h',
+        'heap/mark-compact.cc',
+        'heap/mark-compact.h',
+        'heap/object-stats.cc',
+        'heap/object-stats.h',
+        'heap/objects-visiting-inl.h',
+        'heap/objects-visiting.cc',
+        'heap/objects-visiting.h',
+        'heap/page-parallel-job.h',
+        'heap/remembered-set.cc',
+        'heap/remembered-set.h',
+        'heap/scavenge-job.h',
+        'heap/scavenge-job.cc',
+        'heap/scavenger-inl.h',
+        'heap/scavenger.cc',
+        'heap/scavenger.h',
+        'heap/slot-set.h',
+        'heap/spaces-inl.h',
+        'heap/spaces.cc',
+        'heap/spaces.h',
+        'heap/store-buffer.cc',
+        'heap/store-buffer.h',
+        'i18n.cc',
+        'i18n.h',
+        'icu_util.cc',
+        'icu_util.h',
+        'ic/access-compiler.cc',
+        'ic/access-compiler.h',
+        'ic/call-optimization.cc',
+        'ic/call-optimization.h',
+        'ic/handler-compiler.cc',
+        'ic/handler-compiler.h',
+        'ic/ic-inl.h',
+        'ic/ic-state.cc',
+        'ic/ic-state.h',
+        'ic/ic.cc',
+        'ic/ic.h',
+        'ic/ic-compiler.cc',
+        'ic/ic-compiler.h',
+        'identity-map.cc',
+        'identity-map.h',
+        'interface-descriptors.cc',
+        'interface-descriptors.h',
+        'interpreter/bytecodes.cc',
+        'interpreter/bytecodes.h',
+        'interpreter/bytecode-array-builder.cc',
+        'interpreter/bytecode-array-builder.h',
+        'interpreter/bytecode-array-iterator.cc',
+        'interpreter/bytecode-array-iterator.h',
+        'interpreter/bytecode-array-writer.cc',
+        'interpreter/bytecode-array-writer.h',
+        'interpreter/bytecode-dead-code-optimizer.cc',
+        'interpreter/bytecode-dead-code-optimizer.h',
+        'interpreter/bytecode-label.h',
+        'interpreter/bytecode-generator.cc',
+        'interpreter/bytecode-generator.h',
+        'interpreter/bytecode-peephole-optimizer.cc',
+        'interpreter/bytecode-peephole-optimizer.h',
+        'interpreter/bytecode-pipeline.cc',
+        'interpreter/bytecode-pipeline.h',
+        'interpreter/bytecode-register-allocator.cc',
+        'interpreter/bytecode-register-allocator.h',
+        'interpreter/bytecode-register-optimizer.cc',
+        'interpreter/bytecode-register-optimizer.h',
+        'interpreter/bytecode-traits.h',
+        'interpreter/constant-array-builder.cc',
+        'interpreter/constant-array-builder.h',
+        'interpreter/control-flow-builders.cc',
+        'interpreter/control-flow-builders.h',
+        'interpreter/handler-table-builder.cc',
+        'interpreter/handler-table-builder.h',
+        'interpreter/interpreter.cc',
+        'interpreter/interpreter.h',
+        'interpreter/interpreter-assembler.cc',
+        'interpreter/interpreter-assembler.h',
+        'interpreter/interpreter-intrinsics.cc',
+        'interpreter/interpreter-intrinsics.h',
+        'interpreter/source-position-table.cc',
+        'interpreter/source-position-table.h',
+        'isolate-inl.h',
+        'isolate.cc',
+        'isolate.h',
+        'json-parser.cc',
+        'json-parser.h',
+        'json-stringifier.cc',
+        'json-stringifier.h',
+        'keys.h',
+        'keys.cc',
+        'layout-descriptor-inl.h',
+        'layout-descriptor.cc',
+        'layout-descriptor.h',
+        'list-inl.h',
+        'list.h',
+        'locked-queue-inl.h',
+        'locked-queue.h',
+        'log-inl.h',
+        'log-utils.cc',
+        'log-utils.h',
+        'log.cc',
+        'log.h',
+        'lookup.cc',
+        'lookup.h',
+        'macro-assembler.h',
+        'machine-type.cc',
+        'machine-type.h',
+        'messages.cc',
+        'messages.h',
+        'msan.h',
+        'objects-body-descriptors-inl.h',
+        'objects-body-descriptors.h',
+        'objects-debug.cc',
+        'objects-inl.h',
+        'objects-printer.cc',
+        'objects.cc',
+        'objects.h',
+        'optimizing-compile-dispatcher.cc',
+        'optimizing-compile-dispatcher.h',
+        'ostreams.cc',
+        'ostreams.h',
+        'parsing/expression-classifier.h',
+        'parsing/func-name-inferrer.cc',
+        'parsing/func-name-inferrer.h',
+        'parsing/parameter-initializer-rewriter.cc',
+        'parsing/parameter-initializer-rewriter.h',
+        'parsing/parser-base.h',
+        'parsing/parser.cc',
+        'parsing/parser.h',
+        'parsing/pattern-rewriter.cc',
+        'parsing/preparse-data-format.h',
+        'parsing/preparse-data.cc',
+        'parsing/preparse-data.h',
+        'parsing/preparser.cc',
+        'parsing/preparser.h',
+        'parsing/rewriter.cc',
+        'parsing/rewriter.h',
+        'parsing/scanner-character-streams.cc',
+        'parsing/scanner-character-streams.h',
+        'parsing/scanner.cc',
+        'parsing/scanner.h',
+        'parsing/token.cc',
+        'parsing/token.h',
+        'pending-compilation-error-handler.cc',
+        'pending-compilation-error-handler.h',
+        'perf-jit.cc',
+        'perf-jit.h',
+        'profiler/allocation-tracker.cc',
+        'profiler/allocation-tracker.h',
+        'profiler/circular-queue-inl.h',
+        'profiler/circular-queue.h',
+        'profiler/cpu-profiler-inl.h',
+        'profiler/cpu-profiler.cc',
+        'profiler/cpu-profiler.h',
+        'profiler/heap-profiler.cc',
+        'profiler/heap-profiler.h',
+        'profiler/heap-snapshot-generator-inl.h',
+        'profiler/heap-snapshot-generator.cc',
+        'profiler/heap-snapshot-generator.h',
+        'profiler/profiler-listener.cc',
+        'profiler/profiler-listener.h',
+        'profiler/profile-generator-inl.h',
+        'profiler/profile-generator.cc',
+        'profiler/profile-generator.h',
+        'profiler/sampling-heap-profiler.cc',
+        'profiler/sampling-heap-profiler.h',
+        'profiler/strings-storage.cc',
+        'profiler/strings-storage.h',
+        'profiler/tick-sample.cc',
+        'profiler/tick-sample.h',
+        'profiler/unbound-queue-inl.h',
+        'profiler/unbound-queue.h',
+        'property-descriptor.cc',
+        'property-descriptor.h',
+        'property-details.h',
+        'property.cc',
+        'property.h',
+        'prototype.h',
+        'regexp/bytecodes-irregexp.h',
+        'regexp/interpreter-irregexp.cc',
+        'regexp/interpreter-irregexp.h',
+        'regexp/jsregexp-inl.h',
+        'regexp/jsregexp.cc',
+        'regexp/jsregexp.h',
+        'regexp/regexp-ast.cc',
+        'regexp/regexp-ast.h',
+        'regexp/regexp-macro-assembler-irregexp-inl.h',
+        'regexp/regexp-macro-assembler-irregexp.cc',
+        'regexp/regexp-macro-assembler-irregexp.h',
+        'regexp/regexp-macro-assembler-tracer.cc',
+        'regexp/regexp-macro-assembler-tracer.h',
+        'regexp/regexp-macro-assembler.cc',
+        'regexp/regexp-macro-assembler.h',
+        'regexp/regexp-parser.cc',
+        'regexp/regexp-parser.h',
+        'regexp/regexp-stack.cc',
+        'regexp/regexp-stack.h',
+        'register-configuration.cc',
+        'register-configuration.h',
+        'runtime-profiler.cc',
+        'runtime-profiler.h',
+        'runtime/runtime-array.cc',
+        'runtime/runtime-atomics.cc',
+        'runtime/runtime-classes.cc',
+        'runtime/runtime-collections.cc',
+        'runtime/runtime-compiler.cc',
+        'runtime/runtime-date.cc',
+        'runtime/runtime-debug.cc',
+        'runtime/runtime-forin.cc',
+        'runtime/runtime-function.cc',
+        'runtime/runtime-futex.cc',
+        'runtime/runtime-generator.cc',
+        'runtime/runtime-i18n.cc',
+        'runtime/runtime-internal.cc',
+        'runtime/runtime-interpreter.cc',
+        'runtime/runtime-literals.cc',
+        'runtime/runtime-liveedit.cc',
+        'runtime/runtime-maths.cc',
+        'runtime/runtime-numbers.cc',
+        'runtime/runtime-object.cc',
+        'runtime/runtime-operators.cc',
+        'runtime/runtime-proxy.cc',
+        'runtime/runtime-regexp.cc',
+        'runtime/runtime-scopes.cc',
+        'runtime/runtime-simd.cc',
+        'runtime/runtime-strings.cc',
+        'runtime/runtime-symbol.cc',
+        'runtime/runtime-test.cc',
+        'runtime/runtime-typedarray.cc',
+        'runtime/runtime-utils.h',
+        'runtime/runtime.cc',
+        'runtime/runtime.h',
+        'safepoint-table.cc',
+        'safepoint-table.h',
+        'signature.h',
+        'simulator.h',
+        'small-pointer-list.h',
+        'snapshot/code-serializer.cc',
+        'snapshot/code-serializer.h',
+        'snapshot/deserializer.cc',
+        'snapshot/deserializer.h',
+        'snapshot/natives.h',
+        'snapshot/natives-common.cc',
+        'snapshot/partial-serializer.cc',
+        'snapshot/partial-serializer.h',
+        'snapshot/serializer.cc',
+        'snapshot/serializer.h',
+        'snapshot/serializer-common.cc',
+        'snapshot/serializer-common.h',
+        'snapshot/snapshot.h',
+        'snapshot/snapshot-common.cc',
+        'snapshot/snapshot-source-sink.cc',
+        'snapshot/snapshot-source-sink.h',
+        'snapshot/startup-serializer.cc',
+        'snapshot/startup-serializer.h',
+        'source-position.h',
+        'splay-tree.h',
+        'splay-tree-inl.h',
+        'startup-data-util.cc',
+        'startup-data-util.h',
+        'string-builder.cc',
+        'string-builder.h',
+        'string-search.h',
+        'string-stream.cc',
+        'string-stream.h',
+        'strtod.cc',
+        'strtod.h',
+        'ic/stub-cache.cc',
+        'ic/stub-cache.h',
+        'tracing/trace-event.cc',
+        'tracing/trace-event.h',
+        'transitions-inl.h',
+        'transitions.cc',
+        'transitions.h',
+        'type-cache.cc',
+        'type-cache.h',
+        'type-feedback-vector-inl.h',
+        'type-feedback-vector.cc',
+        'type-feedback-vector.h',
+        'type-info.cc',
+        'type-info.h',
+        'types.cc',
+        'types.h',
+        'typing-asm.cc',
+        'typing-asm.h',
+        'unicode-inl.h',
+        'unicode.cc',
+        'unicode.h',
+        'unicode-cache-inl.h',
+        'unicode-cache.h',
+        'unicode-decoder.cc',
+        'unicode-decoder.h',
+        'uri.cc',
+        'uri.h',
+        'utils-inl.h',
+        'utils.cc',
+        'utils.h',
+        'v8.cc',
+        'v8.h',
+        'v8memory.h',
+        'v8threads.cc',
+        'v8threads.h',
+        'vector.h',
+        'version.cc',
+        'version.h',
+        'vm-state-inl.h',
+        'vm-state.h',
+        'wasm/asm-types.cc',
+        'wasm/asm-types.h',
+        'wasm/asm-wasm-builder.cc',
+        'wasm/asm-wasm-builder.h',
+        'wasm/ast-decoder.cc',
+        'wasm/ast-decoder.h',
+        'wasm/decoder.h',
+        'wasm/encoder.cc',
+        'wasm/encoder.h',
+        'wasm/leb-helper.h',
+        'wasm/module-decoder.cc',
+        'wasm/module-decoder.h',
+        'wasm/switch-logic.h',
+        'wasm/switch-logic.cc',
+        'wasm/wasm-debug.cc',
+        'wasm/wasm-debug.h',
+        'wasm/wasm-external-refs.cc',
+        'wasm/wasm-external-refs.h',
+        'wasm/wasm-function-name-table.cc',
+        'wasm/wasm-function-name-table.h',
+        'wasm/wasm-js.cc',
+        'wasm/wasm-js.h',
+        'wasm/wasm-macro-gen.h',
+        'wasm/wasm-module.cc',
+        'wasm/wasm-module.h',
+        'wasm/wasm-interpreter.cc',
+        'wasm/wasm-interpreter.h',
+        'wasm/wasm-opcodes.cc',
+        'wasm/wasm-opcodes.h',
+        'wasm/wasm-result.cc',
+        'wasm/wasm-result.h',
+        'zone.cc',
+        'zone.h',
+        'zone-allocator.h',
+        'zone-containers.h',
+      ],
+      'conditions': [
+        ['OS!="win" and remove_v8base_debug_symbols==1', {
+          'cflags!': ['-g', '-gdwarf-4'],
+        }],
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+        ['v8_target_arch=="arm"', {
+          'sources': [  ### gcmole(arch:arm) ###
+            'arm/assembler-arm-inl.h',
+            'arm/assembler-arm.cc',
+            'arm/assembler-arm.h',
+            'arm/builtins-arm.cc',
+            'arm/code-stubs-arm.cc',
+            'arm/code-stubs-arm.h',
+            'arm/codegen-arm.cc',
+            'arm/codegen-arm.h',
+            'arm/constants-arm.h',
+            'arm/constants-arm.cc',
+            'arm/cpu-arm.cc',
+            'arm/deoptimizer-arm.cc',
+            'arm/disasm-arm.cc',
+            'arm/frames-arm.cc',
+            'arm/frames-arm.h',
+            'arm/interface-descriptors-arm.cc',
+            'arm/interface-descriptors-arm.h',
+            'arm/macro-assembler-arm.cc',
+            'arm/macro-assembler-arm.h',
+            'arm/simulator-arm.cc',
+            'arm/simulator-arm.h',
+            'compiler/arm/code-generator-arm.cc',
+            'compiler/arm/instruction-codes-arm.h',
+            'compiler/arm/instruction-scheduler-arm.cc',
+            'compiler/arm/instruction-selector-arm.cc',
+            'crankshaft/arm/lithium-arm.cc',
+            'crankshaft/arm/lithium-arm.h',
+            'crankshaft/arm/lithium-codegen-arm.cc',
+            'crankshaft/arm/lithium-codegen-arm.h',
+            'crankshaft/arm/lithium-gap-resolver-arm.cc',
+            'crankshaft/arm/lithium-gap-resolver-arm.h',
+            'debug/arm/debug-arm.cc',
+            'full-codegen/arm/full-codegen-arm.cc',
+            'ic/arm/access-compiler-arm.cc',
+            'ic/arm/handler-compiler-arm.cc',
+            'ic/arm/ic-arm.cc',
+            'ic/arm/ic-compiler-arm.cc',
+            'ic/arm/stub-cache-arm.cc',
+            'regexp/arm/regexp-macro-assembler-arm.cc',
+            'regexp/arm/regexp-macro-assembler-arm.h',
+          ],
+        }],
+        ['v8_target_arch=="arm64"', {
+          'sources': [  ### gcmole(arch:arm64) ###
+            'arm64/assembler-arm64.cc',
+            'arm64/assembler-arm64.h',
+            'arm64/assembler-arm64-inl.h',
+            'arm64/builtins-arm64.cc',
+            'arm64/codegen-arm64.cc',
+            'arm64/codegen-arm64.h',
+            'arm64/code-stubs-arm64.cc',
+            'arm64/code-stubs-arm64.h',
+            'arm64/constants-arm64.h',
+            'arm64/cpu-arm64.cc',
+            'arm64/decoder-arm64.cc',
+            'arm64/decoder-arm64.h',
+            'arm64/decoder-arm64-inl.h',
+            'arm64/deoptimizer-arm64.cc',
+            'arm64/disasm-arm64.cc',
+            'arm64/disasm-arm64.h',
+            'arm64/frames-arm64.cc',
+            'arm64/frames-arm64.h',
+            'arm64/instructions-arm64.cc',
+            'arm64/instructions-arm64.h',
+            'arm64/instrument-arm64.cc',
+            'arm64/instrument-arm64.h',
+            'arm64/interface-descriptors-arm64.cc',
+            'arm64/interface-descriptors-arm64.h',
+            'arm64/macro-assembler-arm64.cc',
+            'arm64/macro-assembler-arm64.h',
+            'arm64/macro-assembler-arm64-inl.h',
+            'arm64/simulator-arm64.cc',
+            'arm64/simulator-arm64.h',
+            'arm64/utils-arm64.cc',
+            'arm64/utils-arm64.h',
+            'compiler/arm64/code-generator-arm64.cc',
+            'compiler/arm64/instruction-codes-arm64.h',
+            'compiler/arm64/instruction-scheduler-arm64.cc',
+            'compiler/arm64/instruction-selector-arm64.cc',
+            'crankshaft/arm64/delayed-masm-arm64.cc',
+            'crankshaft/arm64/delayed-masm-arm64.h',
+            'crankshaft/arm64/delayed-masm-arm64-inl.h',
+            'crankshaft/arm64/lithium-arm64.cc',
+            'crankshaft/arm64/lithium-arm64.h',
+            'crankshaft/arm64/lithium-codegen-arm64.cc',
+            'crankshaft/arm64/lithium-codegen-arm64.h',
+            'crankshaft/arm64/lithium-gap-resolver-arm64.cc',
+            'crankshaft/arm64/lithium-gap-resolver-arm64.h',
+            'debug/arm64/debug-arm64.cc',
+            'full-codegen/arm64/full-codegen-arm64.cc',
+            'ic/arm64/access-compiler-arm64.cc',
+            'ic/arm64/handler-compiler-arm64.cc',
+            'ic/arm64/ic-arm64.cc',
+            'ic/arm64/ic-compiler-arm64.cc',
+            'ic/arm64/stub-cache-arm64.cc',
+            'regexp/arm64/regexp-macro-assembler-arm64.cc',
+            'regexp/arm64/regexp-macro-assembler-arm64.h',
+          ],
+        }],
+        ['v8_target_arch=="ia32"', {
+          'sources': [  ### gcmole(arch:ia32) ###
+            'ia32/assembler-ia32-inl.h',
+            'ia32/assembler-ia32.cc',
+            'ia32/assembler-ia32.h',
+            'ia32/builtins-ia32.cc',
+            'ia32/code-stubs-ia32.cc',
+            'ia32/code-stubs-ia32.h',
+            'ia32/codegen-ia32.cc',
+            'ia32/codegen-ia32.h',
+            'ia32/cpu-ia32.cc',
+            'ia32/deoptimizer-ia32.cc',
+            'ia32/disasm-ia32.cc',
+            'ia32/frames-ia32.cc',
+            'ia32/frames-ia32.h',
+            'ia32/interface-descriptors-ia32.cc',
+            'ia32/macro-assembler-ia32.cc',
+            'ia32/macro-assembler-ia32.h',
+            'compiler/ia32/code-generator-ia32.cc',
+            'compiler/ia32/instruction-codes-ia32.h',
+            'compiler/ia32/instruction-scheduler-ia32.cc',
+            'compiler/ia32/instruction-selector-ia32.cc',
+            'crankshaft/ia32/lithium-codegen-ia32.cc',
+            'crankshaft/ia32/lithium-codegen-ia32.h',
+            'crankshaft/ia32/lithium-gap-resolver-ia32.cc',
+            'crankshaft/ia32/lithium-gap-resolver-ia32.h',
+            'crankshaft/ia32/lithium-ia32.cc',
+            'crankshaft/ia32/lithium-ia32.h',
+            'debug/ia32/debug-ia32.cc',
+            'full-codegen/ia32/full-codegen-ia32.cc',
+            'ic/ia32/access-compiler-ia32.cc',
+            'ic/ia32/handler-compiler-ia32.cc',
+            'ic/ia32/ic-ia32.cc',
+            'ic/ia32/ic-compiler-ia32.cc',
+            'ic/ia32/stub-cache-ia32.cc',
+            'regexp/ia32/regexp-macro-assembler-ia32.cc',
+            'regexp/ia32/regexp-macro-assembler-ia32.h',
+          ],
+        }],
+        ['v8_target_arch=="x87"', {
+          'sources': [  ### gcmole(arch:x87) ###
+            'x87/assembler-x87-inl.h',
+            'x87/assembler-x87.cc',
+            'x87/assembler-x87.h',
+            'x87/builtins-x87.cc',
+            'x87/code-stubs-x87.cc',
+            'x87/code-stubs-x87.h',
+            'x87/codegen-x87.cc',
+            'x87/codegen-x87.h',
+            'x87/cpu-x87.cc',
+            'x87/deoptimizer-x87.cc',
+            'x87/disasm-x87.cc',
+            'x87/frames-x87.cc',
+            'x87/frames-x87.h',
+            'x87/interface-descriptors-x87.cc',
+            'x87/macro-assembler-x87.cc',
+            'x87/macro-assembler-x87.h',
+            'compiler/x87/code-generator-x87.cc',
+            'compiler/x87/instruction-codes-x87.h',
+            'compiler/x87/instruction-scheduler-x87.cc',
+            'compiler/x87/instruction-selector-x87.cc',
+            'crankshaft/x87/lithium-codegen-x87.cc',
+            'crankshaft/x87/lithium-codegen-x87.h',
+            'crankshaft/x87/lithium-gap-resolver-x87.cc',
+            'crankshaft/x87/lithium-gap-resolver-x87.h',
+            'crankshaft/x87/lithium-x87.cc',
+            'crankshaft/x87/lithium-x87.h',
+            'debug/x87/debug-x87.cc',
+            'full-codegen/x87/full-codegen-x87.cc',
+            'ic/x87/access-compiler-x87.cc',
+            'ic/x87/handler-compiler-x87.cc',
+            'ic/x87/ic-x87.cc',
+            'ic/x87/ic-compiler-x87.cc',
+            'ic/x87/stub-cache-x87.cc',
+            'regexp/x87/regexp-macro-assembler-x87.cc',
+            'regexp/x87/regexp-macro-assembler-x87.h',
+          ],
+        }],
+        ['v8_target_arch=="mips" or v8_target_arch=="mipsel"', {
+          'sources': [  ### gcmole(arch:mipsel) ###
+            'mips/assembler-mips.cc',
+            'mips/assembler-mips.h',
+            'mips/assembler-mips-inl.h',
+            'mips/builtins-mips.cc',
+            'mips/codegen-mips.cc',
+            'mips/codegen-mips.h',
+            'mips/code-stubs-mips.cc',
+            'mips/code-stubs-mips.h',
+            'mips/constants-mips.cc',
+            'mips/constants-mips.h',
+            'mips/cpu-mips.cc',
+            'mips/deoptimizer-mips.cc',
+            'mips/disasm-mips.cc',
+            'mips/frames-mips.cc',
+            'mips/frames-mips.h',
+            'mips/interface-descriptors-mips.cc',
+            'mips/macro-assembler-mips.cc',
+            'mips/macro-assembler-mips.h',
+            'mips/simulator-mips.cc',
+            'mips/simulator-mips.h',
+            'compiler/mips/code-generator-mips.cc',
+            'compiler/mips/instruction-codes-mips.h',
+            'compiler/mips/instruction-scheduler-mips.cc',
+            'compiler/mips/instruction-selector-mips.cc',
+            'crankshaft/mips/lithium-codegen-mips.cc',
+            'crankshaft/mips/lithium-codegen-mips.h',
+            'crankshaft/mips/lithium-gap-resolver-mips.cc',
+            'crankshaft/mips/lithium-gap-resolver-mips.h',
+            'crankshaft/mips/lithium-mips.cc',
+            'crankshaft/mips/lithium-mips.h',
+            'full-codegen/mips/full-codegen-mips.cc',
+            'debug/mips/debug-mips.cc',
+            'ic/mips/access-compiler-mips.cc',
+            'ic/mips/handler-compiler-mips.cc',
+            'ic/mips/ic-mips.cc',
+            'ic/mips/ic-compiler-mips.cc',
+            'ic/mips/stub-cache-mips.cc',
+            'regexp/mips/regexp-macro-assembler-mips.cc',
+            'regexp/mips/regexp-macro-assembler-mips.h',
+          ],
+        }],
+        ['v8_target_arch=="mips64" or v8_target_arch=="mips64el"', {
+          'sources': [  ### gcmole(arch:mips64el) ###
+            'mips64/assembler-mips64.cc',
+            'mips64/assembler-mips64.h',
+            'mips64/assembler-mips64-inl.h',
+            'mips64/builtins-mips64.cc',
+            'mips64/codegen-mips64.cc',
+            'mips64/codegen-mips64.h',
+            'mips64/code-stubs-mips64.cc',
+            'mips64/code-stubs-mips64.h',
+            'mips64/constants-mips64.cc',
+            'mips64/constants-mips64.h',
+            'mips64/cpu-mips64.cc',
+            'mips64/deoptimizer-mips64.cc',
+            'mips64/disasm-mips64.cc',
+            'mips64/frames-mips64.cc',
+            'mips64/frames-mips64.h',
+            'mips64/interface-descriptors-mips64.cc',
+            'mips64/macro-assembler-mips64.cc',
+            'mips64/macro-assembler-mips64.h',
+            'mips64/simulator-mips64.cc',
+            'mips64/simulator-mips64.h',
+            'compiler/mips64/code-generator-mips64.cc',
+            'compiler/mips64/instruction-codes-mips64.h',
+            'compiler/mips64/instruction-scheduler-mips64.cc',
+            'compiler/mips64/instruction-selector-mips64.cc',
+            'crankshaft/mips64/lithium-codegen-mips64.cc',
+            'crankshaft/mips64/lithium-codegen-mips64.h',
+            'crankshaft/mips64/lithium-gap-resolver-mips64.cc',
+            'crankshaft/mips64/lithium-gap-resolver-mips64.h',
+            'crankshaft/mips64/lithium-mips64.cc',
+            'crankshaft/mips64/lithium-mips64.h',
+            'debug/mips64/debug-mips64.cc',
+            'full-codegen/mips64/full-codegen-mips64.cc',
+            'ic/mips64/access-compiler-mips64.cc',
+            'ic/mips64/handler-compiler-mips64.cc',
+            'ic/mips64/ic-mips64.cc',
+            'ic/mips64/ic-compiler-mips64.cc',
+            'ic/mips64/stub-cache-mips64.cc',
+            'regexp/mips64/regexp-macro-assembler-mips64.cc',
+            'regexp/mips64/regexp-macro-assembler-mips64.h',
+          ],
+        }],
+        ['v8_target_arch=="x64" or v8_target_arch=="x32"', {
+          'sources': [  ### gcmole(arch:x64) ###
+            'crankshaft/x64/lithium-codegen-x64.cc',
+            'crankshaft/x64/lithium-codegen-x64.h',
+            'crankshaft/x64/lithium-gap-resolver-x64.cc',
+            'crankshaft/x64/lithium-gap-resolver-x64.h',
+            'crankshaft/x64/lithium-x64.cc',
+            'crankshaft/x64/lithium-x64.h',
+            'x64/assembler-x64-inl.h',
+            'x64/assembler-x64.cc',
+            'x64/assembler-x64.h',
+            'x64/builtins-x64.cc',
+            'x64/code-stubs-x64.cc',
+            'x64/code-stubs-x64.h',
+            'x64/codegen-x64.cc',
+            'x64/codegen-x64.h',
+            'x64/cpu-x64.cc',
+            'x64/deoptimizer-x64.cc',
+            'x64/disasm-x64.cc',
+            'x64/frames-x64.cc',
+            'x64/frames-x64.h',
+            'x64/interface-descriptors-x64.cc',
+            'x64/macro-assembler-x64.cc',
+            'x64/macro-assembler-x64.h',
+            'debug/x64/debug-x64.cc',
+            'full-codegen/x64/full-codegen-x64.cc',
+            'ic/x64/access-compiler-x64.cc',
+            'ic/x64/handler-compiler-x64.cc',
+            'ic/x64/ic-x64.cc',
+            'ic/x64/ic-compiler-x64.cc',
+            'ic/x64/stub-cache-x64.cc',
+            'regexp/x64/regexp-macro-assembler-x64.cc',
+            'regexp/x64/regexp-macro-assembler-x64.h',
+          ],
+        }],
+        ['v8_target_arch=="x64"', {
+          'sources': [
+            'compiler/x64/code-generator-x64.cc',
+            'compiler/x64/instruction-codes-x64.h',
+            'compiler/x64/instruction-scheduler-x64.cc',
+            'compiler/x64/instruction-selector-x64.cc',
+          ],
+        }],
+        ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
+          'sources': [  ### gcmole(arch:ppc) ###
+            'compiler/ppc/code-generator-ppc.cc',
+            'compiler/ppc/instruction-codes-ppc.h',
+            'compiler/ppc/instruction-scheduler-ppc.cc',
+            'compiler/ppc/instruction-selector-ppc.cc',
+            'crankshaft/ppc/lithium-ppc.cc',
+            'crankshaft/ppc/lithium-ppc.h',
+            'crankshaft/ppc/lithium-codegen-ppc.cc',
+            'crankshaft/ppc/lithium-codegen-ppc.h',
+            'crankshaft/ppc/lithium-gap-resolver-ppc.cc',
+            'crankshaft/ppc/lithium-gap-resolver-ppc.h',
+            'debug/ppc/debug-ppc.cc',
+            'full-codegen/ppc/full-codegen-ppc.cc',
+            'ic/ppc/access-compiler-ppc.cc',
+            'ic/ppc/handler-compiler-ppc.cc',
+            'ic/ppc/ic-ppc.cc',
+            'ic/ppc/ic-compiler-ppc.cc',
+            'ic/ppc/stub-cache-ppc.cc',
+            'ppc/assembler-ppc-inl.h',
+            'ppc/assembler-ppc.cc',
+            'ppc/assembler-ppc.h',
+            'ppc/builtins-ppc.cc',
+            'ppc/code-stubs-ppc.cc',
+            'ppc/code-stubs-ppc.h',
+            'ppc/codegen-ppc.cc',
+            'ppc/codegen-ppc.h',
+            'ppc/constants-ppc.h',
+            'ppc/constants-ppc.cc',
+            'ppc/cpu-ppc.cc',
+            'ppc/deoptimizer-ppc.cc',
+            'ppc/disasm-ppc.cc',
+            'ppc/frames-ppc.cc',
+            'ppc/frames-ppc.h',
+            'ppc/interface-descriptors-ppc.cc',
+            'ppc/macro-assembler-ppc.cc',
+            'ppc/macro-assembler-ppc.h',
+            'ppc/simulator-ppc.cc',
+            'ppc/simulator-ppc.h',
+            'regexp/ppc/regexp-macro-assembler-ppc.cc',
+            'regexp/ppc/regexp-macro-assembler-ppc.h',
+          ],
+        }],
+        ['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
+          'sources': [  ### gcmole(arch:s390) ###
+            'compiler/s390/code-generator-s390.cc',
+            'compiler/s390/instruction-codes-s390.h',
+            'compiler/s390/instruction-scheduler-s390.cc',
+            'compiler/s390/instruction-selector-s390.cc',
+            'crankshaft/s390/lithium-codegen-s390.cc',
+            'crankshaft/s390/lithium-codegen-s390.h',
+            'crankshaft/s390/lithium-gap-resolver-s390.cc',
+            'crankshaft/s390/lithium-gap-resolver-s390.h',
+            'crankshaft/s390/lithium-s390.cc',
+            'crankshaft/s390/lithium-s390.h',
+            'debug/s390/debug-s390.cc',
+            'full-codegen/s390/full-codegen-s390.cc',
+            'ic/s390/access-compiler-s390.cc',
+            'ic/s390/handler-compiler-s390.cc',
+            'ic/s390/ic-compiler-s390.cc',
+            'ic/s390/ic-s390.cc',
+            'ic/s390/stub-cache-s390.cc',
+            'regexp/s390/regexp-macro-assembler-s390.cc',
+            'regexp/s390/regexp-macro-assembler-s390.h',
+            's390/assembler-s390.cc',
+            's390/assembler-s390.h',
+            's390/assembler-s390-inl.h',
+            's390/builtins-s390.cc',
+            's390/codegen-s390.cc',
+            's390/codegen-s390.h',
+            's390/code-stubs-s390.cc',
+            's390/code-stubs-s390.h',
+            's390/constants-s390.cc',
+            's390/constants-s390.h',
+            's390/cpu-s390.cc',
+            's390/deoptimizer-s390.cc',
+            's390/disasm-s390.cc',
+            's390/frames-s390.cc',
+            's390/frames-s390.h',
+            's390/interface-descriptors-s390.cc',
+            's390/macro-assembler-s390.cc',
+            's390/macro-assembler-s390.h',
+            's390/simulator-s390.cc',
+            's390/simulator-s390.h',
+          ],
+        }],
+        ['OS=="win"', {
+          'variables': {
+            'gyp_generators': '<!(echo $GYP_GENERATORS)',
+          },
+          'msvs_disabled_warnings': [4351, 4355, 4800],
+          # When building Official, the .lib is too large and exceeds the 2G
+          # limit. This breaks it into multiple pieces to avoid the limit.
+          # See http://crbug.com/485155.
+          'msvs_shard': 4,
+        }],
+        ['v8_component=="shared_library"', {
+          'defines': [
+            'BUILDING_V8_SHARED',
+            'V8_SHARED',
+          ],
+        }],
+        ['v8_postmortem_support=="true"', {
+          'sources': [
+            '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
+          ]
+        }],
+        ['v8_enable_i18n_support==1', {
+          'dependencies': [
+            '<(icu_gyp_path):icui18n',
+            '<(icu_gyp_path):icuuc',
+          ],
+          'conditions': [
+            ['icu_use_data_file_flag==1', {
+              'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE'],
+            }, { # else icu_use_data_file_flag !=1
+              'conditions': [
+                ['OS=="win"', {
+                  'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_SHARED'],
+                }, {
+                  'defines': ['ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_STATIC'],
+                }],
+              ],
+            }],
+          ],
+        }, {  # v8_enable_i18n_support==0
+          'sources!': [
+            'i18n.cc',
+            'i18n.h',
+          ],
+        }],
+        ['OS=="win" and v8_enable_i18n_support==1', {
+          'dependencies': [
+            '<(icu_gyp_path):icudata',
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'v8_libbase_sse2',
+      'type': 'static_library',
+      'variables': {
+        'optimize': 'max',
+      },
+      'include_dirs+': [
+        '..',
+      ],
+      'sources': [
+        'base/accounting-allocator.cc',
+        'base/accounting-allocator.h',
+        'base/adapters.h',
+        'base/atomic-utils.h',
+        'base/atomicops.h',
+        'base/atomicops_internals_arm64_gcc.h',
+        'base/atomicops_internals_arm_gcc.h',
+        'base/atomicops_internals_atomicword_compat.h',
+        'base/atomicops_internals_mac.h',
+        'base/atomicops_internals_mips_gcc.h',
+        'base/atomicops_internals_mips64_gcc.h',
+        'base/atomicops_internals_portable.h',
+        'base/atomicops_internals_ppc_gcc.h',
+        'base/atomicops_internals_s390_gcc.h',
+        'base/atomicops_internals_tsan.h',
+        'base/atomicops_internals_x86_gcc.cc',
+        'base/atomicops_internals_x86_gcc.h',
+        'base/atomicops_internals_x86_msvc.h',
+        'base/bits.cc',
+        'base/bits.h',
+        'base/build_config.h',
+        'base/compiler-specific.h',
+        'base/cpu.cc',
+        'base/cpu.h',
+        'base/division-by-constant.cc',
+        'base/division-by-constant.h',
+        'base/file-utils.cc',
+        'base/file-utils.h',
+        'base/flags.h',
+        'base/format-macros.h',
+        'base/functional.cc',
+        'base/functional.h',
+        'base/hashmap.h',
+        'base/ieee754.cc',
+        'base/ieee754.h',
+        'base/iterator.h',
+        'base/lazy-instance.h',
+        'base/logging.cc',
+        'base/logging.h',
+        'base/macros.h',
+        'base/once.cc',
+        'base/once.h',
+        'base/platform/elapsed-timer.h',
+        'base/platform/time.cc',
+        'base/platform/time.h',
+        'base/platform/condition-variable.cc',
+        'base/platform/condition-variable.h',
+        'base/platform/mutex.cc',
+        'base/platform/mutex.h',
+        'base/platform/platform.h',
+        'base/platform/semaphore.cc',
+        'base/platform/semaphore.h',
+        'base/safe_conversions.h',
+        'base/safe_conversions_impl.h',
+        'base/safe_math.h',
+        'base/safe_math_impl.h',
+        'base/smart-pointers.h',
+        'base/sys-info.cc',
+        'base/sys-info.h',
+        'base/utils/random-number-generator.cc',
+        'base/utils/random-number-generator.h',
+      ],
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+        ['OS=="linux"', {
+            'conditions': [
+              ['nacl_target_arch=="none"', {
+                'link_settings': {
+                  'libraries': [
+                    '-ldl',
+                    '-lrt'
+                  ],
+                },
+              }, {
+                'defines': [
+                  'V8_LIBRT_NOT_AVAILABLE=1',
+                ],
+              }],
+            ],
+            'sources': [
+              'base/platform/platform-linux.cc',
+              'base/platform/platform-posix.cc'
+            ],
+          }
+        ],
+        ['OS=="android"', {
+            'sources': [
+              'base/platform/platform-posix.cc'
+            ],
+            'link_settings': {
+              'target_conditions': [
+                ['_toolset=="host" and host_os!="mac"', {
+                  # Only include libdl and librt on host builds because they
+                  # are included by default on Android target builds, and we
+                  # don't want to re-include them here since this will change
+                  # library order and break (see crbug.com/469973).
+                  # These libraries do not exist on Mac hosted builds.
+                  'libraries': [
+                    '-ldl',
+                    '-lrt'
+                  ]
+                }]
+              ]
+            },
+            'conditions': [
+              ['host_os=="mac"', {
+                'target_conditions': [
+                  ['_toolset=="host"', {
+                    'sources': [
+                      'base/platform/platform-macos.cc'
+                    ]
+                  }, {
+                    'sources': [
+                      'base/platform/platform-linux.cc'
+                    ]
+                  }],
+                ],
+              }, {
+                'sources': [
+                  'base/platform/platform-linux.cc'
+                ]
+              }],
+            ],
+          },
+        ],
+        ['OS=="qnx"', {
+            'link_settings': {
+              'target_conditions': [
+                ['_toolset=="host" and host_os=="linux"', {
+                  'libraries': [
+                    '-lrt'
+                  ],
+                }],
+                ['_toolset=="target"', {
+                  'libraries': [
+                    '-lbacktrace'
+                  ],
+                }],
+              ],
+            },
+            'sources': [
+              'base/platform/platform-posix.cc',
+              'base/qnx-math.h',
+            ],
+            'target_conditions': [
+              ['_toolset=="host" and host_os=="linux"', {
+                'sources': [
+                  'base/platform/platform-linux.cc'
+                ],
+              }],
+              ['_toolset=="host" and host_os=="mac"', {
+                'sources': [
+                  'base/platform/platform-macos.cc'
+                ],
+              }],
+              ['_toolset=="target"', {
+                'sources': [
+                  'base/platform/platform-qnx.cc'
+                ],
+              }],
+            ],
+          },
+        ],
+        ['OS=="freebsd"', {
+            'link_settings': {
+              'libraries': [
+                '-L/usr/local/lib -lexecinfo',
+            ]},
+            'sources': [
+              'base/platform/platform-freebsd.cc',
+              'base/platform/platform-posix.cc'
+            ],
+          }
+        ],
+        ['OS=="openbsd"', {
+            'link_settings': {
+              'libraries': [
+                '-L/usr/local/lib -lexecinfo',
+            ]},
+            'sources': [
+              'base/platform/platform-openbsd.cc',
+              'base/platform/platform-posix.cc'
+            ],
+          }
+        ],
+        ['OS=="netbsd"', {
+            'link_settings': {
+              'libraries': [
+                '-L/usr/pkg/lib -Wl,-R/usr/pkg/lib -lexecinfo',
+            ]},
+            'sources': [
+              'base/platform/platform-openbsd.cc',
+              'base/platform/platform-posix.cc'
+            ],
+          }
+        ],
+        ['OS=="aix"', {
+          'sources': [
+            'base/platform/platform-aix.cc',
+            'base/platform/platform-posix.cc'
+          ]},
+        ],
+        ['OS=="solaris"', {
+            'link_settings': {
+              'libraries': [
+                '-lnsl -lrt',
+            ]},
+            'sources': [
+              'base/platform/platform-solaris.cc',
+              'base/platform/platform-posix.cc'
+            ],
+          }
+        ],
+        ['OS=="mac"', {
+          'sources': [
+            'base/platform/platform-macos.cc',
+            'base/platform/platform-posix.cc'
+          ]},
+        ],
+        ['OS=="win"', {
+          'defines': [
+            '_CRT_RAND_S'  # for rand_s()
+          ],
+          'variables': {
+            'gyp_generators': '<!(echo $GYP_GENERATORS)',
+          },
+          'conditions': [
+            ['gyp_generators=="make"', {
+              'variables': {
+                'build_env': '<!(uname -o)',
+              },
+              'conditions': [
+                ['build_env=="Cygwin"', {
+                  'sources': [
+                    'base/platform/platform-cygwin.cc',
+                    'base/platform/platform-posix.cc'
+                  ],
+                }, {
+                  'sources': [
+                    'base/platform/platform-win32.cc',
+                    'base/win32-headers.h',
+                  ],
+                }],
+              ],
+              'link_settings':  {
+                'libraries': [ '-lwinmm', '-lws2_32' ],
+              },
+            }, {
+              'sources': [
+                'base/platform/platform-win32.cc',
+                'base/win32-headers.h',
+              ],
+              'msvs_disabled_warnings': [4351, 4355, 4800],
+              'link_settings':  {
+                'libraries': [ '-lwinmm.lib', '-lws2_32.lib' ],
+              },
+            }],
+          ],
+        }],
+      ],
+    },
+    {
+      'target_name': 'v8_libplatform_sse2',
+      'type': 'static_library',
+      'variables': {
+        'optimize': 'max',
+      },
+      'dependencies': [
+        'v8_libbase_sse2',
+      ],
+      'include_dirs+': [
+        '..',
+        '../include',
+      ],
+      'sources': [
+        '../include/libplatform/libplatform.h',
+        'libplatform/default-platform.cc',
+        'libplatform/default-platform.h',
+        'libplatform/task-queue.cc',
+        'libplatform/task-queue.h',
+        'libplatform/worker-thread.cc',
+        'libplatform/worker-thread.h',
+      ],
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '../include',
+        ],
+      },
+    },
+    {
+      'target_name': 'v8_libsampler_sse2',
+      'type': 'static_library',
+      'variables': {
+        'optimize': 'max',
+      },
+      'dependencies': [
+        'v8_libbase_sse2',
+      ],
+      'include_dirs+': [
+        '..',
+        '../include',
+      ],
+      'sources': [
+        'libsampler/v8-sampler.cc',
+        'libsampler/v8-sampler.h'
+      ],
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ],
+      'direct_dependent_settings': {
+        'include_dirs': [
+          '../include',
+        ],
+      },
+    },
+    {
+      'target_name': 'natives_blob_sse2',
+      'type': 'none',
+      'conditions': [
+        [ 'v8_use_external_startup_data==1', {
+          'conditions': [
+            ['want_separate_host_toolset==1', {
+              'dependencies': ['js2c_sse2#host'],
+            }, {
+              'dependencies': ['js2c_sse2'],
+            }],
+          ],
+          'actions': [{
+            'action_name': 'v8_sse2_concatenate_natives_blob',
+            'inputs': [
+              '../tools/concatenate-files.py',
+              '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.bin',
+              '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental_sse2.bin',
+              '<(SHARED_INTERMEDIATE_DIR)/libraries-extras_sse2.bin',
+              '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental-extras_sse2.bin',
+            ],
+            'conditions': [
+              ['want_separate_host_toolset==1', {
+                'target_conditions': [
+                  ['_toolset=="host"', {
+                    'outputs': [
+                      '<(PRODUCT_DIR)/natives_blob_host_sse2.bin',
+                    ],
+                    'action': [
+                      'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob_host_sse2.bin'
+                    ],
+                  }, {
+                    'outputs': [
+                      '<(PRODUCT_DIR)/natives_blob_sse2.bin',
+                    ],
+                    'action': [
+                      'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob_sse2.bin'
+                    ],
+                  }],
+                ],
+              }, {
+                'outputs': [
+                  '<(PRODUCT_DIR)/natives_blob_sse2.bin',
+                ],
+                'action': [
+                  'python', '<@(_inputs)', '<(PRODUCT_DIR)/natives_blob_sse2.bin'
+                ],
+              }],
+            ],
+          }],
+        }],
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host', 'target'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ]
+    },
+    {
+      'target_name': 'js2c_sse2',
+      'type': 'none',
+      'conditions': [
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ],
+      'variables': {
+        'library_files': [
+          'js/macros.py',
+          'messages.h',
+          'js/prologue.js',
+          'js/runtime.js',
+          'js/v8natives.js',
+          'js/symbol.js',
+          'js/array.js',
+          'js/string.js',
+          'js/math.js',
+          'third_party/fdlibm/fdlibm.js',
+          'js/regexp.js',
+          'js/arraybuffer.js',
+          'js/typedarray.js',
+          'js/iterator-prototype.js',
+          'js/collection.js',
+          'js/weak-collection.js',
+          'js/collection-iterator.js',
+          'js/promise.js',
+          'js/messages.js',
+          'js/array-iterator.js',
+          'js/string-iterator.js',
+          'js/templates.js',
+          'js/spread.js',
+          'js/proxy.js',
+          'debug/mirrors.js',
+          'debug/debug.js',
+          'debug/liveedit.js',
+        ],
+        'experimental_library_files': [
+          'js/macros.py',
+          'messages.h',
+          'js/harmony-atomics.js',
+          'js/harmony-sharedarraybuffer.js',
+          'js/harmony-simd.js',
+          'js/harmony-string-padding.js',
+          'js/promise-extra.js',
+          'js/harmony-async-await.js'
+        ],
+        'libraries_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.bin',
+        'libraries_experimental_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental_sse2.bin',
+        'libraries_extras_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-extras_sse2.bin',
+        'libraries_experimental_extras_bin_file': '<(SHARED_INTERMEDIATE_DIR)/libraries-experimental-extras_sse2.bin',
+        'conditions': [
+          ['v8_enable_i18n_support==1', {
+            'library_files': ['js/i18n.js'],
+            'experimental_library_files': [
+              'js/icu-case-mapping.js',
+              'js/intl-extra.js',
+             ],
+          }],
+        ],
+      },
+      'actions': [
+        {
+          'action_name': 'v8_sse2_js2c',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(library_files)',
+          ],
+          'outputs': ['<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc',
+            'CORE',
+            '<@(library_files)',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_bin',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(library_files)',
+          ],
+          'outputs': ['<@(libraries_bin_file)'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/libraries_sse2.cc',
+            'CORE',
+            '<@(library_files)',
+            '--startup_blob', '<@(libraries_bin_file)',
+            '--nojs',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_experimental',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(experimental_library_files)',
+          ],
+          'outputs': ['<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc',
+            'EXPERIMENTAL',
+            '<@(experimental_library_files)',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_experimental_bin',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(experimental_library_files)',
+          ],
+          'outputs': ['<@(libraries_experimental_bin_file)'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/experimental-libraries_sse2.cc',
+            'EXPERIMENTAL',
+            '<@(experimental_library_files)',
+            '--startup_blob', '<@(libraries_experimental_bin_file)',
+            '--nojs',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_extras',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(v8_extra_library_files)',
+          ],
+          'outputs': ['<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc',
+            'EXTRAS',
+            '<@(v8_extra_library_files)',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_extras_bin',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(v8_extra_library_files)',
+          ],
+          'outputs': ['<@(libraries_extras_bin_file)'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/extras-libraries_sse2.cc',
+            'EXTRAS',
+            '<@(v8_extra_library_files)',
+            '--startup_blob', '<@(libraries_extras_bin_file)',
+            '--nojs',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_experimental_extras',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(v8_experimental_extra_library_files)',
+          ],
+          'outputs': [
+            '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc',
+          ],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc',
+            'EXPERIMENTAL_EXTRAS',
+            '<@(v8_experimental_extra_library_files)',
+          ],
+        },
+        {
+          'action_name': 'v8_sse2_js2c_experimental_extras_bin',
+          'inputs': [
+            '../tools/js2c.py',
+            '<@(v8_experimental_extra_library_files)',
+          ],
+          'outputs': ['<@(libraries_experimental_extras_bin_file)'],
+          'action': [
+            'python',
+            '../tools/js2c.py',
+            '<(SHARED_INTERMEDIATE_DIR)/experimental-extras-libraries_sse2.cc',
+            'EXPERIMENTAL_EXTRAS',
+            '<@(v8_experimental_extra_library_files)',
+            '--startup_blob', '<@(libraries_experimental_extras_bin_file)',
+            '--nojs',
+          ],
+        },
+      ],
+    },
+    {
+      'target_name': 'postmortem-metadata_sse2',
+      'type': 'none',
+      'variables': {
+        'heapobject_files': [
+            'objects.h',
+            'objects-inl.h',
+        ],
+      },
+      'actions': [
+          {
+            'action_name': 'v8_sse2_gen-postmortem-metadata',
+            'inputs': [
+              '../tools/gen-postmortem-metadata.py',
+              '<@(heapobject_files)',
+            ],
+            'outputs': [
+              '<(SHARED_INTERMEDIATE_DIR)/debug-support.cc',
+            ],
+            'action': [
+              'python',
+              '../tools/gen-postmortem-metadata.py',
+              '<@(_outputs)',
+              '<@(heapobject_files)'
+            ]
+          }
+        ]
+    },
+    {
+      'target_name': 'mksnapshot_sse2',
+      'type': 'executable',
+      'dependencies': ['v8_base_sse2', 'v8_nosnapshot_sse2', 'v8_libplatform_sse2'],
+      'include_dirs+': [
+        '..',
+      ],
+      'sources': [
+        'snapshot/mksnapshot.cc',
+      ],
+      'conditions': [
+        ['v8_enable_i18n_support==1', {
+          'dependencies': [
+            '<(icu_gyp_path):icui18n',
+            '<(icu_gyp_path):icuuc',
+          ]
+        }],
+        ['want_separate_host_toolset==1', {
+          'toolsets': ['host'],
+        }, {
+          'toolsets': ['target'],
+        }],
+      ],
+    },
+  ],
+}
diff --git a/src/core/core_module.pro b/src/core/core_module.pro
index 44e8ac613..7fe1a49e9 100644
--- a/src/core/core_module.pro
+++ b/src/core/core_module.pro
@@ -10,6 +10,29 @@ linking_pri = $$OUT_PWD/$$getConfigDir()/$${TARGET}.pri
     error("Could not find the linking information that gn should have generated.")
 }
 
+# find the shared libraries in the link line
+# remove those in lib/sse2 that are only replacements for the normal ones
+# collect all shared libraries so they can be installed
+for(private_lib, LIBS_PRIVATE) {
+    contains(private_lib, .*\.so) {
+        contains(private_lib, .*/lib/sse2/.*) {
+            LIBS_PRIVATE -= $$private_lib
+            shlibs_sse2 += $$private_lib
+        } else {
+            shlibs += $$private_lib
+        }
+    }
+}
+
+# set the shared libraries to be installed
+# add an rpath to their installation location
+shlib_install_path = $$[QT_INSTALL_LIBS]/qtwebengine
+!isEmpty(shlibs) {
+    shlibs.files += $$shlibs
+    shlibs_sse2.files += $$shlibs_sse2
+    LIBS_PRIVATE += -Wl,--rpath,$$shlib_install_path
+}
+
 load(qt_module)
 
 api_library_name = qtwebenginecoreapi$$qtPlatformTargetSuffix()
@@ -100,7 +123,12 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
         locales.path = $$[QT_INSTALL_TRANSLATIONS]/qtwebengine_locales
         resources.CONFIG += no_check_exist
         resources.path = $$[QT_INSTALL_DATA]/resources
-        INSTALLS += locales resources
+        # install the shared libraries
+        shlibs.CONFIG += no_check_exist
+        shlibs.path = $$shlib_install_path
+        shlibs_sse2.CONFIG += no_check_exist
+        shlibs_sse2.path = $$shlib_install_path/sse2
+        INSTALLS += locales resources shlibs shlibs_sse2
 
         !use?(system_icu) {
             icu.CONFIG += no_check_exist
-- 
2.13.0